Alpha Video Training
Results 1 to 4 of 4

Thread: 3rd parameter in Eval function

  1. #1
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    141

    Default 3rd parameter in Eval function

    Wondering if anyone knows how the 3rd parameter in the function EVAL() can be used.

    The xbasic function Eval() displays the following in context help when entered in the xbasic editor.

    C Eval(C Expression[,C eval_context[,C eval_cursorstate]])

    The first parameter is the expression to evaluate "1+2", "ALLTRIM(LASTNAME)" etc.

    The second parameter eval_context allows you to evaluate the Expression in the context of a named database. That verifies the expression references only fields that exist in that table such as LastName

    However, the Expression is only evaluated against the first record in the table.

    The third parameter is undocumented. However, the term Cursor is often used to refer to the pointer to the current record.

    The Alpha5 Expression Builder uses some form of Eval to test the expression you have entered. However, you can navigate through the records.

    The code in the Expression Builder refers to CursorState, so it is related.

    How do I know anything about the code in the Expression Builder, well;


    • run a script with a single command debug(1) to launch the debugger
    • Debugger -> Settings
    • select - Trap all errors
    • enter the following command in the interactive window
    • ? a5_get_expression("'test'","nodatabase",'C')
    • Click Ok to bypass the error: File not found
    • Attempt to navigate to the first record using the VCR controls.


    The debugger should appear with error;
    Variable type mismatch cursor[] not found

    The following block of code should appear in the debugger.

    Code:
    tempPP = set_cursor_state(cursor_state,physical_tablenames,physical_tablenames,"first",0)
    cursor_state = tempPP.cursor_state
    recno_text     = tempPP.recno_text
    generate_recno_number_bitmap(recno_text)
    recno_source = tempPP.recno_source

  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,685

    Default Re: 3rd parameter in Eval function

    That makes it about as clear as mud!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  3. #3
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    141

    Default Re: 3rd parameter in Eval function

    Like they say "It's complicated". I can try the question again.
    If you don't understand the question I doubt you know the answer.

    The EVAL() function takes up to 3 parameters.

    C Eval(C Expression[,C eval_context[,C eval_cursorstate]])

    The 3rd parameter is as far as I can tell is undocumented.
    Does anyone know how the third parameter can be used?

    The rest of the original question was just a bit of research I threw in, which muddied the waters.
    Thanks for taking the time to reply.

  4. #4
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,388

    Default Re: 3rd parameter in Eval function

    looks like the third parameter is there for Alpha Software only : https://documentation.alphasoftware....ate%20function

Similar Threads

  1. How to pass a parameter to an Xbasic function?
    By TheDuke in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 08-31-2013, 10:50 PM
  2. Can enum be used in a UDF for a function parameter?
    By jkletrovets in forum Alpha Five Version 9 - Desktop Applications
    Replies: 9
    Last Post: 05-19-2009, 12:00 PM
  3. using variables for function parameter values
    By Cheryl Lemire in forum Alpha Five Version 7
    Replies: 4
    Last Post: 08-17-2006, 11:47 PM
  4. Trapping a NUL Parameter in a Function
    By KeithW in forum Alpha Five Version 7
    Replies: 3
    Last Post: 08-02-2006, 01:08 PM
  5. Function Parameter calling bug?
    By csda1 in forum Alpha Five Version 5
    Replies: 0
    Last Post: 07-29-2004, 10:48 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
  •