SitesMasstec
Programmer
Macro substituition in a form
Hi colleagues!
I'm using a form for data entry with a maximum of 20 itens.
I will have in each item (row in form)
product 1 .....
product 2 .....
product 20 .....
I wrote for item/product 1 (Thisform.Pageframe1.Page1.txtPRO1) in the GotFocus procedure:
IF Thisform.Pageframe1.Page1.txtPRO1.Value="R"
Thisform.Pageframe1.Page1.txtDES1.InputMask='9999'
ENDIF
IF Thisform.Pageframe1.Page1.txtPRO1.Value="E"
Thisform.Pageframe1.Page1.txtDES1.InputMask='999999'
ENDIF
Will I have to repeat all this for the other 19 itens, changing only the numbers 2 to 19 OR is it possible to use macro substitution to avoid this?
For example, I imagine this:
MyNumber=2
MyCommand="Thisform.Pageframe1.Page1.txtDES"+ALLTRIM(STR(MyNumber))+".InputMask"
and then:
&MyCommand='9999'
If this is possible, WHERE I have to wrote this code?
Thanks,
SitesMasstec
Hi colleagues!
I'm using a form for data entry with a maximum of 20 itens.
I will have in each item (row in form)
product 1 .....
product 2 .....
product 20 .....
I wrote for item/product 1 (Thisform.Pageframe1.Page1.txtPRO1) in the GotFocus procedure:
IF Thisform.Pageframe1.Page1.txtPRO1.Value="R"
Thisform.Pageframe1.Page1.txtDES1.InputMask='9999'
ENDIF
IF Thisform.Pageframe1.Page1.txtPRO1.Value="E"
Thisform.Pageframe1.Page1.txtDES1.InputMask='999999'
ENDIF
Will I have to repeat all this for the other 19 itens, changing only the numbers 2 to 19 OR is it possible to use macro substitution to avoid this?
For example, I imagine this:
MyNumber=2
MyCommand="Thisform.Pageframe1.Page1.txtDES"+ALLTRIM(STR(MyNumber))+".InputMask"
and then:
&MyCommand='9999'
If this is possible, WHERE I have to wrote this code?
Thanks,
SitesMasstec