Results 1 to 4 of 4

Thread: FoxPro & operator

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    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.

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226
    Hi

    VarX = 3 * 4

    Vary = VarX

    Another method:

    Z = 3
    W = 4

    VarX = Z * W

    Vary = VarX


  3. #3
    New Member
    Join Date
    Mar 2000
    Posts
    14
    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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    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
  •  



Click Here to Expand Forum to Full Width