I have some code that builds a dialog box with two options the user can choose. I donot know in advance how many options the user will require and so I am going to cater for up to 20 options.
I want to modify this code that creates a predefined number of options the user can choose.
I want to create the options depending if variables get populated.
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
optionbutton 16, 30, 67, 8, “delete”
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog as userdialog1
on error resumenext
dialog mydialog1
if err=102 then
msbox “ marco has hit a problem and has exited”
end if
bla
bla
bla
end sub
I was thinking of something like this below. The first option will always be created, the second would only be created if the variable gets populated. I will have 20 different variables and for each one that gets populated I want to create and option
Dim myvariable as string
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
if myvariable = “found” then
optionbutton 16, 30, 67, 8, “delete”
end if
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
Attachamate does not seem to like the IF/End if
at least not the way I have done it, is there a way to do this?
thank you smiler44
I want to modify this code that creates a predefined number of options the user can choose.
I want to create the options depending if variables get populated.
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
optionbutton 16, 30, 67, 8, “delete”
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog as userdialog1
on error resumenext
dialog mydialog1
if err=102 then
msbox “ marco has hit a problem and has exited”
end if
bla
bla
bla
end sub
I was thinking of something like this below. The first option will always be created, the second would only be created if the variable gets populated. I will have 20 different variables and for each one that gets populated I want to create and option
Dim myvariable as string
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
if myvariable = “found” then
optionbutton 16, 30, 67, 8, “delete”
end if
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
Attachamate does not seem to like the IF/End if
at least not the way I have done it, is there a way to do this?
thank you smiler44