Alpha Video Training
Results 1 to 4 of 4

Thread: branch expression sees field name as variable

  1. #1
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default branch expression sees field name as variable

    I've attached a simple example database. Open the only form and enter a number in the field and then press the button. The code on the button is a branching command that should display a message box if the number entered in the field is greater than 5. Alpha throws an error that the variable is not recognized. That "variable" is the field name.

    I can make this work by getting the field value into a variable and then using that in the branching expression. I just don't understand why this doesn't work as is.

    Bob Arbuthnot

  2. #2
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: branch expression sees field name as variable

    Bob,

    Add .value to the field...do not know why AS doesn't do this but it doesn't. Use Inline xbasic if wanted.

    Don't even need the topparent...just the .value
    like:
    Code:
    if topparent:Numeric_field.value <5 then 
    	GOTO LESS_THAN_5
    end if
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  3. #3
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: branch expression sees field name as variable

    Hi Mike,

    Thanks for the confirmation. I'm like you in that it seems like A5 should handle this situation and create the proper xbasic code for the Action Script. I think I will report this as a bug.

    Bob

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Baker
    Join Date
    Jun 2006
    Location
    Near Cherry Hill, NJ
    Posts
    1,296

    Default Re: branch expression sees field name as variable

    Bob

    Doesn't work in Version 7 either.

    Tom

Similar Threads

  1. Field Selection by Expression or Variable
    By Robin Hoare in forum Alpha Five Version 7
    Replies: 10
    Last Post: 01-08-2006, 02:47 PM
  2. A/S set Variable to Constant or Expression
    By John Gamble in forum Alpha Five Version 6
    Replies: 11
    Last Post: 12-14-2005, 06:34 PM
  3. Question about Set Variable to Expression Result
    By Robert Cheley in forum Alpha Five Version 5
    Replies: 1
    Last Post: 07-08-2003, 07:52 PM
  4. variable in a report order expression
    By Mary Nickerson in forum Alpha Five Version 4
    Replies: 3
    Last Post: 01-17-2003, 04:18 AM
  5. Using Script Variable in Expression
    By Dean Hall in forum Alpha Four Versions 7 and 8
    Replies: 4
    Last Post: 11-01-2002, 04:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •