How to make the view embed source button work for the global embeds

I could have sworn I saw a feature request posted recently on here, like within the last month or two, but it might have been a comment read out on a Clarionlive youtube presentation asking if the view source button for the embed editor in the global embeds could work.

One way you can make this work is to edit the templates and shift the template code from the #Application and #Program templates to a #Procedure template and then make that #procedure template the %FirstProcedure (typically called main).

This shifts the global embeds to the 1st procedure into visible tree structure of appgen where it then becomes possible to view the “global” or “#program” embeds in context with source.

I think these templates are a good lesson of demonstrating obfuscation! :grinning:


#Procedure(GlobalEmbeds,'Global Embeds Repositioned')
#Restrict,Where(%grpRestrictToFirstProcedure() )

#Return %True
#Return %False

Then choose what you want to move from the global embeds to this procedure template…

Anyway cant find the original post or the point made in the clarion live youtube vid I saw recently, but the idea is out there now, question is how many 3rd party addons will this idea break?

TLDR bad idea.

The templates ABBLDEXP.tpw (for ABC) and BUILDEXP.TPW (for clarion) have the code in there to build the EXP file.

Interestingly, in the ABBLDEXP.tpw C6.3 file is where all the ABC librarys are exported and it ties into another file ABOOP.TPW which is the %ReadABCFiles #group. There is also another group which calls the #Service template command which looks very similar to the #RunDll, ie the Retain which makes me wonder if this #Service is a way to add functionality to the AppGen. Something for the future.

Now if appears that if you happen to want activeinvisible always on, edit this file ABBLDEXP.tpw and change
#Set(%SysActiveInvisible,%False) to %True.

Lots of other settings there, but I know from the ngs the ActiveInvisible answer was a frequently asked question and this appears to be where a global change can be made. Havent tried it myself though so if it doesnt work it can easily be undone.

Anyway getting back to the making %FirstProcedure the #Application and #Program procedure.
In a #Procedure if you specify two #Embeds with the same %identifier it duplicates any embed code placed on one of the embeds on the other embed. So I duplicated the#Application #Embeds in the first procedure to see if that would duplicate embed code added via the global windows into the first procedure, sadly not. So the scope of the #Embed %identifier’s uniqueness appears to be limited to the template its used in.

The other problem which might not be a problem is overriding the project system. I’m generating my .exp file just fine, but the IDE still wants the generated files seen in the project system which I’ve combined into just one big file for now.

Maybe a bit of #Pragma experimenting to do, or maybe best to not waste any more time on this as its currently a bit broken up having the #Application embeds in the first procedure, and then having to go back into the global section of the IDE to make changes to global data if I’m not using globals in a dct.

And then theres the compiler and linker which doesnt work at the moment with this first procedure setup unless I can override the appgen a bit more.

My template that writes template is working nice though! :wink:

It was discussed on an OpenClarion webinar. It’s not possible to view global embeds in context. This is likely because global embeds span across multiple different CLW files. So seeing them in context would require the embeditor to generate the correct file context.

As one delves into it it becomes apparent that this would be a very complex problem to solve, starting with a list of possible files, which in itself would be very difficult to know.

even just generating the global embeds on a global DLL takes forever anyway.

It reminds me of having a sore back. You try to remember all of the little things you need to do while you’re picking something up off of the floor, because you don’t want to stoop down again any time soon.

With the undocumented features, it was worth exploring what could be done.