So is there some sort of internal linkage taking place when I have nested #Button Multi’s like in the example above?
TIA
Edit
The TXA values look alright.
%iscwInterfaceList MULTI LONG (1, 2)
%iscwInterfaceName DEPEND %iscwInterfaceList DEFAULT TIMES 2
WHEN (1) ('MyInterface1')
WHEN (2) ('MyInterface2')
%iscwInterfaceParent DEPEND %iscwInterfaceList DEFAULT TIMES 0
%iscwInterfaceType DEPEND %iscwInterfaceList LONG TIMES 0
%iscwInterfaceCOM DEPEND %iscwInterfaceList LONG TIMES 0
%iscwInterfaceProcedureList DEPEND %iscwInterfaceList MULTI LONG TIMES 2
WHEN (1) (1, |
2)
WHEN (2) (1, |
2)
%iscwInterfaceProcedureName DEPEND %iscwInterfaceProcedureList DEFAULT TIMES 2
WHEN (1)TIMES 2
WHEN (1) ('MyInterface1ProcedureName')
WHEN (2) ('MyInterface1OtherProcedureName')
WHEN (2)TIMES 2
WHEN (1) ('MyInterface2MyProcedureName')
WHEN (2) ('MyInterface2MyOtherProcedureName')
As you can see, the Children are not all sitting in a flat table, but rather in a sub list. You can’t access them without first #FIXing the Parent in some manner.
What I do in this type of situation is use local multi-valued symbols or hidden multi-valued #PROMPTs. Then experiment with #PREPARE and WHENACCEPTED(…) to fill those local lists for use in the #PROMPT statements.
Unfortunately I don’t have a similar example to share with you. It will take a fair bit of fiddling, but you should be able to get it to work.
I did wonder this, originally I didnt have the %ChildParentField but because I couldnt get Fix, Find or Select to work, I added the %ChildParentField and tried Fix, Find and Select again and still no joy.
Its because the #Button(’’),Multi is a instance number when most of the examples in the help docs are using multisymbols with text.
I didnt know if #Prompt('Parent',From(%ParentList,,%ParentField),%ProcParentField
was some sort of undocumented feature because normally for multisymbol #Prompt('Parent',From(%ParentList),%ProcParentField
would be enough, but in #Button Multi’s they are instance numbers.
The last attempt was #Prompt('Parent',From(%ParentList,,%ParentField),%ProcParentField,WhenAccepted(%MyFix)
It’s a bit of a tightrope. WHENACCEPTED fires only when it’s actually accepted. #PREPARE happens a bit more consistently, so you want to use #PREPARE as much as possible, because it represents the current state of affairs. Sprinkle in WHENACCEPTED to adjust things as the state of affairs changes.
I’m refactoring the template at the moment as its getting a little on the large side, my tpl file is now just these few lines, which is much more manageable. It is a case of getting the right code in the right place though.
It might be firing but here its not doing anything.
I got some code which is supposed to clear a @s255 prompt and its not clearing it. #Set(%field,’’) doesnt clear the symbol either. #Clear(%field) doesnt clear the symbol either.
The thing I’m finding with this computer is some days it works, and other days the same code doesnt work, and it could be clarion code or template code thats not working, there is no pattern to it or anything, which is annoying because I cant write a program to make this windows computer secure, because windows is insecure by design, 10years I’ve been trying to secure various computers, very annoying.
All I can say is that templates are quirky. I don’t think I’ve ever been able to clear a #PROMPT, except possibly with #ENABLE(…),CLEAR. Even with that, I see that I’ve often coded pessimistically, so I wouldn’t trust that either.
The templates are astonishingly flexible, but they are also difficult to get working the way you want. Additionally, no one really knows how they work (including SoftVelocity). It think this is why they didn’t recode the generation engine when they changed to the new IDE, because they couldn’t reverse engineer the code. If they recoded it from scratch, it would have broken everyone’s templates, and Clarion’s priority is to ensure people’s code keeps working, as much as possible.
I might peek at it using Ghidra to see what I can find out.
Did you ever meet Veronica Chapman over here, she used to come round my house and teach me stuff in clarion, assembler, and things. She very succinctly summed up programming.
It is my understanding that Anders wrote the Turbo Pascal compiler and that
a couple of other people who subsequently went to work for Neils at TopSpeed
wrote the editor and various other bits and bobs. Whether Neils himself
wrote an earlier, pre-release version of TP I have no idea…
This #Error is a bit of a dark horse! I didnt realise it pops up in the AppGen window, I’ve only ever seen it display messages in the compiler window, this has certainly made things a little easier.
Just keep at it. I’ve had as much or more experience with templates than anyone out there, and it would still take me few hours of fiddling to get what you’re trying to do work reliably. Once you’re done, you’ll have a much better insight into how that all works.
This is one of the things I’ve been trying to get working since last year but it refuses to work so I’m now going through the map and exp files to work out whats going on.
I dont know whether the side channel mitigations that are set in the bios are affecting this, but the #Rundll with a clarion wrapper to outputdebugstringa just refuses to work and I dont know if its some of the MS anti virus exploit protection stuff causing problems or what.
Finally got the clarion wrapper to work, it was a path error that was stopping it!
So we can do this #RunDll(‘drive:\path\filename.dll’, ‘MAIN@FRsc’, %DbgVwMsg), release, win32
and not just #RunDll(‘filename.dll’, ‘MAIN@FRsc’, %DbgVwMsg), release, win32
Thing is though, I did have the path added to the redir so I think the #RunDll does not use the redir file which will explain alot. So obvious with hindsight.
I can finish off my language translator which is rewriting the templates adding a group call to pertinent lines in the template either before or after which sends the output to debugview so I can see the value of symbols etc. But I only ever work on the original template , the language translator processes the template and puts the modified version in the IDE folders.
Even these cause a crash surprisingly! #Set(DbgVwMsg,‘Path() = ’ & Path() ) #RunDll(‘drive:\path\filename.dll’, ‘MAIN@FRsc’, %DbgVwMsg), release, win32
I did wonder if there was some special variation of Longpath(‘filename.dll’) which only worked when called from within the template, but the path() doesnt work nor does the Longpath(path()), yet I have Longpath(path()) working inside a #Set in other templates.
Something has obviously changed on this computer again!
For some strange reason path() and longpath are not working in this template but I have them working in other templates so I dont know if its the test code I have here which is causing the problem, the template needs tidying up which might make Longpath and path work on this machine here.
Finally getting the debugview output I wanted from the Templates. Its not finished yet, but its interesting seeing the orders stuff gets called in and how often some of the template commands get called, #Tabs get called alot when in them.
Went into the Global Properties template here and all the Tab’s fire.
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Validate 1
[1596] #Validate 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Tab 2
[1596] #Tab('&1 Include Files')
[1596] #Validate 3
[1596] #Tab 2
Pressed Make button here, but at least I can see the value’s in %symbols now like %module in this example.
[1596] #Application
[1596] #Prepare
[1596] #EndPrepare
[1596] #Sheet,HScroll
[1596] #EndSheet
[1596] Before #FOR(%Module), WHERE (%Module <> %Program)
[1596] #FOR(%Module=), WHERE (%Module= <> %Program=SimpleApp.clw)
[1596] #GENERATE(%Module=Simpl001.clw)
[1596] After #ENDFOR - (%Module), WHERE (%Module <> %Program)
Now I just need to automate adding the debugview group to all templates.
Its surprising how many messages debugview can handle in 1 second, like just over 8,000 messages which is surprising, but I suspect its probably machine dependent.