Dimming a large Statement....

Ches's Avatar
Light Poster
OK So I'm in a small rut in one of my programs...... I don't know if it even can be done, but I'd like to know how to state coding in a massive dim........Such as like

Dim BigIF as ????(<-What do I call this if it can be done/can it even be done in dim?)

BigIF=If this0 then If this1 then If this2 then If this3 then If this4 then If this then Do this.

In truth, It isn't neccessary(because i could just re-write the coding), it will just save me about 50 lines of coding.....
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I could not get what you are asking. Are you talking about the array of longs?
Ches's Avatar
Light Poster
OK what I mean is to take a formula (such as: if y>1 and x<1 and z=1 then Q.caption="1")
and dim it as a variable....Long(as far as I understand it) Won't allow me to use coding statements such as if/then/else....and thats what i need to use.........
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Still I am not sure but whatever condition you wish you can give? if y>1 and x<1 and z=1 then Q.caption="1" is very much possible.

Also dimming inside the ifs is also possible.
Ches's Avatar
Light Poster
I Was just wondering what statement you should use to dim the total statements:[ if y>1 and x<1 and z=1 then Q.caption="1"] and call it by a name such as : Bob
OK..I'll try to explain a little better....

I want to say somethign like
dim water as ?? (i don't know what its called)
water= { if y>1 and x<1 and z=1 then Q.caption="1"}
so i can use it like this....
If label1="32" then Water
and it will put the statement called "water" where the word ( "water" ) is used.....
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Nope that is not possible in VB as far as I know but I am not a VB expert. What you are saying are something like macros in C++
Ches's Avatar
Light Poster
Ok thank you ......
Another question i Have is .....
I have an imagebox...I want you to have a list of options for what to do with this item(thats in the imagebox) come down when you right click(Which i'm assuming is the dblclikc option....)...How could i do that or something similar to it.....?


Thanks


*Ches
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I am not sure what you mean by image box? Use a menu to give user the options to select something.
riffz's Avatar, Join Date: Apr 2007
Newbie Member
Are you saying that you want to use that long IF code constantly throughout your program? If so, put it in a private sub, then just call it when you want to use that code. So...

Code:
'declare sub
private sub water()

'put if code here
if y>1 and x<1 and z=1 then Q.caption="1"

end sub

Then whenever you want to use that code, just call the sub:

Code:
call water()