[SOLVED]Dialog Manager to generate Maintain Code in .mnt file
I have a need to generate a lot of identical code for all fieldnames in a stack. For example: Form2.T10.ReadOnly=stk_ReadOnly.T10; Form2.T10.ToolTipText=IF stk_ReadOnly.T10 EQ "0" then var_ttrw else var_ttro; Form2.T20.ReadOnly=stk_ReadOnly.T20; Form2.T20.ToolTipText=IF stk_ReadOnly.T20 EQ "0" then var_ttrw else var_ttro; Form2.T30.ReadOnly=stk_ReadOnly.T30; Form2.T30.ToolTipText=IF stk_ReadOnly.T30 EQ "0" then var_ttrw else var_ttro; Form2.T40.ReadOnly=stk_ReadOnly.T40; Form2.T40.ToolTipText=IF stk_ReadOnly.T40 EQ "0" then var_ttrw else var_ttro; F....
Normally i would code a loop in Dialog Manager and generate the fieldnames and the lines of code. Am i rignt in suspecting that i cannot do this in an MNT file?
Regards, MatsThis message has been edited. Last edited by: Mats Sjoberg,
Mats Sundelin Cybernetics Business Solutions AB
November 19, 2010, 04:16 AM
GamP
Yes, you're absolutely right about that. The maintain parser will not recognize DM commands.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 22, 2010, 08:40 AM
Mats Sjoberg
Thanks. I created a utility that types out the code so i can cut and paste it. //Mats
Mats Sundelin Cybernetics Business Solutions AB
November 25, 2010, 07:32 AM
Håkan
Mats,
what about calling a a Focexec with the DM code which is written to a file which is readable for Maintain.
It looks like you want to generate code to set form properties. If so, it might be easier to do that in JavaScript, like processing an array of controls with name substitution to get the right data source for each property value. Of course all the data element would have to be part of the run-time page.