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;
The debugger should appear with error;
Variable type mismatch cursor[] not found
The following block of code should appear in the debugger.
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
Comment