|
-
Apr 6th, 2000, 03:39 AM
#1
Thread Starter
Lively Member
FoxPro "&" operator
FoxPro have the operator & ("macro substitution"), which is very powerful. How can I obtain the same functionality in VB?
FoxPro example:
STORE "3+4" TO varX
varY = &varX
(in that way, varY will contain 7)
VB example:
????
Thanks in advance.
-
Apr 6th, 2000, 08:32 AM
#2
Addicted Member
Hi
VarX = 3 * 4
Vary = VarX
Another method:
Z = 3
W = 4
VarX = Z * W
Vary = VarX
-
Apr 6th, 2000, 05:44 PM
#3
New Member
Lyla,
I don't think that is what JMuller is asking.
The expression is in string format...how can it be un-string?
VarX = "3*4"
Vary=VarX --- still is a string JMuller wants it to be the value of 3*4 ie 12.
FireBeast.
PS Macro substitution is very usefull, but I don't think you can do it it VB
-
Apr 6th, 2000, 07:21 PM
#4
Thread Starter
Lively Member
Let me explain the problem in another way. Supose this code in FoxPro:
varX = 5
varA = "IIf(varX=1, 2, 4)"
? 10 + &varA && Shows 14
varA = "IIf(varX>5, 3, IIf(varX=5, 8, 7))"
? 10 + &varA && Shows 18
The problem is: how can I change the condition on the addition, without change the addition itself?
Thanks again...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|