Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Dimming a large Statement.... (http://www.go4expert.com/forums/dimming-statement-t2805/)

Ches 1Feb2007 18:56

Dimming a large Statement....
 
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 1Feb2007 20:35

Re: Dimming a large Statement....
 
I could not get what you are asking. Are you talking about the array of longs?

Ches 1Feb2007 22:42

Re: Dimming a large Statement....
 
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 2Feb2007 09:50

Re: Dimming a large Statement....
 
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 3Feb2007 05:32

Re: Dimming a large Statement....
 
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 3Feb2007 07:10

Re: Dimming a large Statement....
 
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 6Feb2007 01:13

Re: Dimming a large Statement....
 
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 6Feb2007 09:06

Re: Dimming a large Statement....
 
I am not sure what you mean by image box? Use a menu to give user the options to select something.

riffz 8Apr2007 19:37

Re: Dimming a large Statement....
 
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()


All times are GMT +5.5. The time now is 17:10.