Index Expression (Magic xpa 2.x)
To set an Index Expression, you need to enter zero (0) in the Index property and press the Tab key. The expression number you enter in Index Expression property points to an expression in the Expression Editor to be evaluated at runtime.
If you use an index expression:
The result of the evaluation of the expression must be a valid index number for the selected data object. If, at runtime, a legal value is not found for the expression used for the dynamic definition of an index, or if no expression is specified, Magic xpa uses the zero index, the physical order, as the default.
The Index expression is evaluated as soon as the task starts executing, before any of the task’s variables are available. Therefore, an index expression that is based on variables, not constant values, must either use local variables that receive arguments, or use the variables of a parent task. Any Index expression based on variables that are not available yields a zero index.
When you use an index number inside an expression, if you want Magic xpa to automatically update it, you must qualify the index expression explicitly by using the INDEX literal as follows. When you use the Index number in an expression, specify the index number nn as 'nn'INDEX.
For example, if you enter '2'INDEX as an index expression in the Expression Editor and later insert a new index in the Index repository for the table ahead of the existing ones,changing the old index entry from #2 to #3, Magic xpa automatically updates the '2'INDEX to '3'INDEX in the expression.
The Index Expression property is not accessible if the task has a SQL command.
The Expression property is only available when the XML Source Variable property is blank. In this property you can only use alphanumeric expressions.
In this property you can define an expression that evaluates to the XML file location or URL.
This property will specify a file name, not XML content. You can enter the: file:\\ (the default can be omitted), http:// and https:// (e.g. 'c:\my.xml', 'http:/localhost/my.xml').
A non-zero value here identifies an expression that will be evaluated to a DB physical table name at runtime. You can optionally include its logical name or explicit location (server/driver/directory) in the name. The evaluated table name is then used to redirect the table, from the default table name specified for it in the Data repository.