Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With numbers please

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello i have nearly finished my programe excepct that i now need 6 random numbers to be in ascending order i.e. 2,8,14,45,47,49 not 49,8,14,47,45,2 ive been trying now for a couple of hours but cannot seem to get it to work i am only very new to programming but if i use a statement like this

dim swap as integer

if label1.caption > label2.caption then
swap = label1.caption
label1.caption = label2.caption
label2.caption = swap

please can anyone please help me .

 
try this
if val(label1.caption) > val(label2.caption) then


David Paulson


 
Hi thank you for you'r Help but one more problem now all then numbers are in range i.e. 1 to 9 10 to 19 20 to 29 30 to 39 and 40 to 49 and all have different colors for there numbers like the lotery numbers but now the colors are all wrong ????
 
dim swap as integer
Dim colorswap As Long
if val(label1.caption) > val(label2.caption) then
swap = label1.caption
label1.caption = label2.caption
label2.caption = swap
colorswap = Label1.ForeColor
Label1.ForeColor = Label2.ForeColor
Label2.ForeColor = colorswap



David Paulson


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top