Hello, I’m looking for a way to cycle through all the procedures in an app in Clarion 6 (legacy).
To be able to scroll through each screen component.
This last part was easy, going through all the procedures to get here that I don’t know.
loop i# = firstfield() to lastfield()
(i#){Prop:type}
end
It would be like a loop in all procedures, and within that loop, a loop like the one above.
FirstField() to LastField() is not always reliable. This code will work.
curField long(0)
code
loop
curField = 0{PROP:NextField, curField}
if not curField
break
end
case curField{PROP:Type}
of CREATE:Entry
of CREATE:toolbar
end
end
This isn’t really a practical thing for a running program, as the properties you want to read all require that a window/report be opened, and all of those entities are hosted inside individual procedures/methods/routines.
You’d probably have better luck writing a template that builds a tree or something.
The idea is to call each window, read all its screen components and close it, from next to last.
It would be a call to each app window to read its screen components.
You’ll need to write a template to add as a Procedure Extension Template or Embed Template, which will generate every procedure name in code.
Look at existing templates for working examples of a Procedure Extension Template or an Embed Template.
The basic template code to get every procedure name is below, but you will probably need to flesh it out so that the existing procedure name is not called recursively and stuck in a recursive loop.
#FOR(%Procedure)
%Procedure ! This is the procedurename in code but what about parameters?
#ENDFOR
To get the window controls on a procedure, look at Field Equate Labels.
A Window will be 0, controls will be a number incrementing by 1.
A Menubar will be -1, controls on the menubar will be a number decrementing by 1.
If you are planning to link in some .net window’s into your app, you will find you cant access the window controls, just the window title for the .net window.
Thats one way to access the code, the otherway is to look at Spy++ and variants to understand how that is working. This will then give you the option to perform what you want on your clarion, but also other apps.
Hello, the idea is to translate the app at run time. Reading each screen component and doing the translation, something very manual and as a test.
Because this is legacy Clarion 6, without many tools.