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

curScript

Method:

GetIndVariable

static obj GetIndVariable(int index=1, string *name, boolean sorted=false, string scope="local", int stackIndex)

Get variables list of current script

Description:

The GetIndVariables returns the value of the variable corresponding to a given position in the "list" of current script variables and, optionally, the name of the variable itself.

"Lists" are relative to scopes; each scope maintains a list with all variables (of the current script) belonging to that scope (and to specify a list means to specify a scope).

Parameters:
index

the index of the variable in the list

name

on output, the name of the variable requested

sorted

specifies if the list must be sorted alphabetically, before getting the index-th variable

scope

defines the list to get the variable from. Possible lists corresponds to possible scopes: local, global, application, session, persistent

stackIndex
Notes:

Example: the following script prints all local variables (with their names) of the current script

totVars = curScript.GetTotVariables("local")
theVar = ""
for(i = 1; i <= totVars; i++)
{
theVar = curScript.GetIndVariable(i, &name, false, "local") 
$name + ": " + theVar + "<br>"
}

Note that the variables i, totVars and theVar will not be included in the printed list because they have been defined after the GetTotVariables call.

Besides, note that theVar is initialized before the loop (to empty string) in order to define its class and to avoid typecast problems. Without that initialization, if the first variable of the list is an int theVar is initialized to int and following typecasts could fail if subsequent variables are not numbers (that is a common case).

See also:

GetTotVariables

Implementation:
C
 

Return to the curScript class