Displaying a Procedure Name

Is it possible to get a procedure name to include it upon a window. I am trying to have a single procedure I can call via Actions > Call A Procedure > Procedure Name > “Work In Progress” that will include the procedure name. eg. If the menu choice was “Users_Browse”, the Work In Progress window would display something to the effect of “Users_Browse is a Work In Progress”.
Any tips would be most welcome.

For ABC

In %CWRoot%\Template\ABProcs.tpw have a look at:

#PROCEDURE(ToDo,'Procedure not yet defined'),DEFAULT
%Procedure PROCEDURE
  CODE
#IF(%NoGenerateGlobals)
  MESSAGE('The Procedure %procedure had not been defined', 'Procedure Not Defined')
#ELSE
  GlobalErrors.ThrowMessage(Msg:ProcedureToDo,'%Procedure')     #<! This procedure acts as a place holder for a procedure yet to be defined
#ENDIF
  SETKEYCODE(0)
#IF(~%NoGenerateGlobals)
  GlobalResponse = RequestCancelled                             #<! Request cancelled is the implied action
#ENDIF

Then search for %NoGenerateGlobals which should take you to %CWRoot%\Template\ABChain.tpl

#TAB('Global O&bjects')
    #DISPLAY('')
    #PROMPT('Don''t generate globals', CHECK),%NoGenerateGlobals,AT(10)
    #BUTTON('&Error Manager'),AT(,,170)

For CW look at %CWRoot%\Template\ToDo.TPW

You’ll see the functionality you require in the Clarion template chain doesnt exist, but you can code something yourself.

Since you want to call a single WIP Msg Procedure, and not add the actual Users_Browse procedure in the App Tree, you could pass the “Users_Browse” as a parameter. And have addition text in case you want to say more. The Procedure Name can be any text you like that’s user friendly, not a valid Clarion name.

WIP_Msg('Users_Browse','Check back in the May release.')

WIP_Msg PROCEDURE(STRING ProcName, STRING MoreMsg)
    Code
    Message(Clip(ProcName) & ' is a Work In Progress.' & |
            '||' & MoreMsg , |
            'Pardon Our Dust', Icon:Clarion)
    Return

You can even Start it as a new thread since that can take up to 3 Strings (not <omittable>). That would let you have an MDI window.


Another idea would be a Wip_Msg Procedure Extension Template that would generate that Message at the top of the procedure and Return, like the TODO Template.

But if the system was running as the Dev or Backdoor user, or on a Dev PC, it could have special actions. The Message could have a Continue button that let’s it run. Or not show at all, but maybe add to the Window an obvious “WIP” String to remind you that end users cannot use it.

This way Users_Browse can be in the App Tree and be worked on, but users are told its WIP.


ABC WindowManager template generates a GlobalErrors.SetProcedureName('procname') in .Init that there’s a matching .GetProcedureName() that returns it.

I’m pretty sure Clarion does this automatically? When designing a procedure if you call a new procedure the new procedure gets added as a “TO DO” procedure and Clarion displays a message to the user if that To Do procedure gets called at runtime?

So, are you hoping to do more than that?

Edit: Clarified what I was talking about.
Edit: To answer your question, yes, it would be very easy to do using a Template.

Thanks, the message is working nicely and achieving what I was hoping for. Next step is to learn to make an Extension Template!
Regards, Kenn Sharples

Yes, the ultimate goal was to be able to get a message with the procedure name, the Work In Progress was just an example, Thanks for the response

This is the result:

The code use was as per Carl Barnes advice:
The procedure was a source code wizard
The Prototype was: (string,string)
The Parameters were: (PROCNAME,MOREMSG)
The code entered to the processed code embed point was:
! Messages
!---------

Message('The '&Clip(ProcName) & ' option is a Work In Progress.' & |
           '||' & MoreMsg , |
           'WORK IN PROGRESS', Icon:EXCLAMATION)
Return

Further to the creation of my Work In Progress message, I have been looking to alter the color and font of the message to make it more outstanding, more attention attracting.
I have been looking at PROP:COLOR and PROP:FONT, but cannot determine where to place the statements, if this is indeed the way to address this. Any suggestions?

If you can hang on until Thursday lunchtime I might have a template you can use!

I tried to get 2 AI agents to write it but that was “interesting” [lol]

I have it working and just want to tidy it up a bit.

To answer your question, I was going to suggest that you just edit the window in the procedure you are using, but I see it uses a MESSAGE statement to display your message, so no, you can’t edit the font in a MESSAGE. (Unless you have Capesoft’s message replacement template - which uses a window, not a message)

You cannot color or change fonts with a Message, you have to use a Window:

Copy the Msg procedure incase you want it
Delete the Msg procedure
Add Msg procedure, but pick Window template
Pick an MDI Window type and make it CENTER
Note: an MDI window MUST be Started in a new thread or you will get an error.

Add a local String variable Loc:Wip and Window String control for it.
Loc:Wip='The '&Clip(ProcName) & ' is a Work In Progress.'

For the MoreMsg same, but could be a TEXT that is READONLY,FLAT and 3 lines tall so Height 30 to allow a long bit of text. If this was blank you could have some standard text so you don’t have to keep typing it.

IF MoreMsg THEN
   Loc:Msg = MoreMsg
ELSE 
   Loc:Msg = 'Please Check back soon...
END

Prototype and Parameters can be the same with both Type and Label.

(string PROCNAME, string MOREMSG)

Exception is Parameters on a function cannot have the return type, only the Prototype e.g. (),Long,Proc

I’ve uploaded a template to Github…

It’s a bit rough and ready, probably not something I would use myself, but you might find it useful.

I’ve included instructions and an example app that you can play with, if you wish.

I have downloaded your work and have run the demo, the result is impressive as, from my perspective, it clearly identifies the procedure it is coming from.
I am afraid I have only Clarion 9.0 and have not been able to see the demo app, but will look at the source files to see if I can understand what you have done.
Many thanks for the effort you have put into this. It is appreciated.