hi,
i have a dialog box which contains "make of model" and an input box for "color". if the input box is blank, then the default color will be RED.
i need to input each "make" and "color" into the data-base.
this code seems awkward.can this code be improved? what if i needed to add a 3rd input-box, such as "shape"? i can add the input-box but how do i add that to the code?
thanks
zach
i have a dialog box which contains "make of model" and an input box for "color". if the input box is blank, then the default color will be RED.
i need to input each "make" and "color" into the data-base.
this code seems awkward.can this code be improved? what if i needed to add a 3rd input-box, such as "shape"? i can add the input-box but how do i add that to the code?
Code:
Sub Main()
Dim list(1000) as String
Dim list1(1000) as String
Begin Dialog dlgModelType 0, 1, 330, 300, "Default Color"
ButtonGroup .ButtonPressed
OkButton 250, 20, 50, 14
Text 74, 80, 40, 20, "MAKE"
Text 74, 88, 40, 20, "====="
Text 118, 80, 40, 20, "COLOUR"
Text 118, 88, 40, 20, "========"
Text 76, 100, 30, 20, "AAA:"
Text 76, 114, 30, 20, "BBB:"
Text 76, 128, 30, 20, "CCC:"
Text 74, 142, 30, 20, "DDD:"
Text 76, 154, 30, 20, "EEE:"
Text 78, 170, 30, 20, "FFF:"
Text 74, 184, 30, 20, "GGG:"
Text 74, 198, 30, 20, "HHH:"
Text 84, 212, 30, 20, "III:"
Text 80, 226, 30, 20, "JJJ:"
TextBox 116, 96, 38, 12, .tbx0
TextBox 116, 110, 38, 12, .tbx1
TextBox 116, 124, 38, 12, .tbx2
TextBox 116, 138, 38, 12, .tbx3
TextBox 116, 152, 38, 12, .tbx4
TextBox 116, 166, 38, 12, .tbx5
TextBox 116, 180, 38, 12, .tbx6
TextBox 116, 194, 38, 12, .tbx7
TextBox 116, 208, 38, 12, .tbx8
TextBox 116, 222, 38, 12, .tbx9
End Dialog
'------------------------------------------------------------------
Dim dMain1 as dlgModelType
nRet = Dialog(dMain1)
Typ00 = dMain1.tbx0
Typ01 = dMain1.tbx1
Typ02 = dMain1.tbx2
Typ03 = dMain1.tbx3
Typ04 = dMain1.tbx4
Typ05 = dMain1.tbx5
Typ06 = dMain1.tbx6
Typ07 = dMain1.tbx7
Typ08 = dMain1.tbx8
Typ09 = dMain1.tbx9
List(1) = Typ00
List(2) = Typ01
List(3) = Typ02
List(4) = Typ03
List(5) = Typ04
List(6) = Typ05
List(7) = Typ06
List(8) = Typ07
List(9) = Typ08
List(10) = Typ09
'---------------
List1(1) = "AAA"
List1(2) = "BBB"
List1(3) = "CCC"
List1(4) = "CCC"
List1(5) = "EEE"
List1(6) = "FFF"
List1(7) = "GGG"
List1(8) = "HHH"
List1(9) = "III"
List1(10) = "JJJ"
rw = 1
for i = 1 to 10
mymake = List1 (i)
for j = rw to 10
mycolor = List(j)
if trim(mycolor) = "" then mycolor = "RED"
msgbox mymake + " - " + mycolor
'DO STUFF
'------------------------
'------------------------
rw = rw + 1
exit for
next j
next i
'------------------------------------------------------------------
End Sub
thanks
zach