Biferno 1.7 Tabasoft.it

Application: ItaliaScuola Back-Office3
Reference
Admin | Edit | Reference | Cache | Logs
Click on a class name to see the description of that particular class:

Predefined Classes

ansi
array
biferno
boolean
cacheItem
char
classInfo
client
collection
curApp
curFile
curScript
db
double
error
file
folder
header
httpPage
imageUtils
int
long
memberInfo
multipart
object
ref
regexp
request
search
serverInfo
smtp
stackItem
string
time
unix
unsigned
 

Application Classes

Banner
BrowserBar
Ctrl_Form
FCKeditor
Form
GridChartGraph
Histogram
LocalDate
Result
condb
cookie
folderExt
headerExt
httpExt
mysqlFulltext
objHtml
requestExt
tableExport
utils
 

Functions

Functions

function

Function:

Eval

string Eval(string text, boolean resume)

Processes a string of text containing Biferno code

Description:

The Eval function processes a string of text containing Biferno code. We can write:

textToEval = "a = 3"
Eval(textToEval)
$a

line 3 of the example will print the value of the variable a, which is 3. The a variable has been defined and assigned the value 3 when the text passed to the Eval function was processed.

Notice that the textToEval string does not start with the "<?" characters. This is because the Eval implicitly assumes a "<?" tag before processing the text. If the textToEval string contains plain text, the text would have to be prefixed with the "?>" characters. An example is:

textToEval = "a = 3?><b>Hello Word</b>"
result = Eval(textToEval)
$result

Notice that this behavior is different from the include behavior. In an included file, before writing Biferno code, the "<?" must be explicitly used.

The last example also shows the meaning of the return variable of the function, which contains the entire text sent as output during execution. The first example generated no output, and the function returned the empty string. In the second example the result string contains the text: "<b>Hello Word</b>".

Parameters:
text

the text to process

resume

specifies the resum mode (see note)

Returns:

contains the entire text sent as output during execution of text.

Notes:

What happens if the text passed to the Eval function (textToEval string) generates an error?

In this case the value of the third parameter (resume, left to its default value, false, in the previous examples) is crucial. If an error is generated the following applies:

resume is false: we can control if Eval will interrupt our script using the error.Resume function in the textToEval string with the usual error handling rules. Notice that some errors will interrupt code execution even if error.Resume has been called, as e.g. the Err_BadSyntax error. In any case, the code line after the call to the Eval function the global variable err will contain the code of the generated error.

resume is true: the Eval function will interrupt the execution of the text contained in textToEval according to the error handling rules, but, instead of interrupting the execution of the calling script upon an error, will return the name of the generated error in the return string. In any case, on the code line after the call to the Eval function the global variable err will contain the code of the generated error.

See also:

curScript.ValueOf

Implementation:
C
 

Return to the function class

Update Man Page