There are a couple of ways to do this, but arrays of strings
are your safest bet.
There are a couple of ways to implement string arrays as well,
depending upon what you want to do, but here's a simple one:
function clrtypdlg(clrtyp) as logical
dim clr(3) as string
dim typ(3) as string
dim wclr as smallint
dim wtyp as smallint
clr(1) = "Green"
clr(2) = "Blue"
clr(3) = "Red"
typ(1) = "House"
typ(2) = "Flat"
typ(3) = "Bungalow"
dialog title "Select color and type"
control PopupMenu title from variable clr
into wclr
control PopupMenu title from variable typ
into wtyp
control OKButton
control CancelButton
if CommandInfo (CMD_INFO_DLG_OK)
then clrtyp = clr (wclr)+ " "+ typ(wtyp)
clrtypdlg = TRUE
else clrtyp = ""
clrtypdlg = FALSE
end if
end function
This will also work with ListBox controls, but RadioGroup
controls make you jump through an extra hoop, since "title from variable"
doesn't work for them (MB 5.0). Given the following function:
function concat_a (a(0) as string, ByVal ct as smallint, ByVal s as string)
as string
dim c as string
dim i as smallint
do case ct
case 0 concat_a = ""
case 1 concat_a = a (1)
case else c = a(1)
for i = 2 to ct
c = c + s + a(i)
next
concat_a = c
end case
end function
A RadioGroup control would then be defined like this:
control RadioGroup title concat_a (clr,3,";")
into wclr
HTH
Spencer
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 11843