Dimming a large Statement....

Light Poster
1Feb2007,18:56   #1
Ches's Avatar
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.....
Go4Expert Founder
1Feb2007,20:35   #2
shabbir's Avatar
I could not get what you are asking. Are you talking about the array of longs?
Light Poster
1Feb2007,22:42   #3
Ches's Avatar
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.........
Go4Expert Founder
2Feb2007,09:50   #4
shabbir's Avatar
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.
Light Poster
3Feb2007,05:32   #5
Ches's Avatar
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.....
Go4Expert Founder
3Feb2007,07:10   #6
shabbir's Avatar
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++
Light Poster
6Feb2007,01:13   #7
Ches's Avatar
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
Go4Expert Founder
6Feb2007,09:06   #8
shabbir's Avatar
I am not sure what you mean by image box? Use a menu to give user the options to select something.
Newbie Member
8Apr2007,19:37   #9
riffz's Avatar
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()