Copyright © 2003 Tabasoft S.a.s.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled Appendix 1, GNU Free Documentation License.
Table of Contents
Table of Contents
print — Outputs a string
void print(str);
string str;
Allows to print (insert on the Biferno script output) the value of a variable, a constant, or the result of an expression
Parameters
the string to print
Instead of the print keyword it is possible to use the dollar symbol, $$. Using the dollar symbol before and after a variable name, its value can be printed outside of the Biferno code delimiters. This is shown in the following example, where the “val” parameter is passed to the “newpage.bfr” page and takes the value of the myString variable, which is output on the HTML page using the $$ symbol set before and after the variable name. The delimiter tags of the Biferno code are not used. The next row of code shown an alternative manner of obtaining the same result using the print function.
<? myString = "Hello World" ?> <html><body> <? //Print the value of the myString variable print(myString) //Same effect as previous instruction $$myString ?> <br> <a href="newpage.bfr?val=$$myString$$">Nuova Pagina</a> <a href="otherpage.bfr?val=<? print(myString) ?>">Other Page</a> </body></html>
Eval — Processes a string of text containing Biferno code
string Eval(text, resume);
string text;
boolean resume;
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
the text to process
specifies the resum mode (see note)
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.
Table of Contents
srandom —
void srandom(seed);
int seed;
Reinitialize the machine seed to get random numbers (with method.ansi.random)
Parameters
A number to use to restart the random sequence. If 0, the computer clock is used.
strch —
string strch(str, ch);
string str;
char ch;
Locates the first occurrence of char ch in string str
Parameters
The string to search in
The character to search for
strcmp —
int strcmp(str1, str2);
string str1;
string str2;
strcspn —
int strcspn(str1, str2);
string str1;
string str2;
strncat —
string strncat( | str1, | |
| str2, | ||
n); |
| string | str1; |
| string | str2; |
| int | n; |
strncmp —
int strncmp(str1, str2, n);
string str1;
string str2;
int n;
strncpy —
string strncpy(str, n);
string str;
int n;
strpbrk —
string strpbrk(str1, str2);
string str1;
string str2;
strrch —
string strrch(str, ch);
string str;
char ch;
Locates the last occurrence of char ch in string str
Parameters
The string to search in
The character to search for
strspn —
int strspn(str1, ch);
string str1;
char ch;
Table of Contents
array —
void array(...);
The class "array" describes mono (or multi) dimensional vector of objects all belonging to the same class. An array can be initialized as follows:
myArray = array(value1, value2, value3 ...)
or:
myArray = array() myArray[1] = value1 myArray[2] = value2 myArray[3] = value3 ...
An associative array has names for all (or part of) its elements:
myArray = array(name1:value1, name2:value2, name3:value3 ...)
or:
myArray = array() myArray[1] = value1 myArray.name[1] = name1 myArray[2] = value2 myArray.name[2] = name2 myArray[3] = value3 myArray.name[3] = value3 ...
Add —
void Add(element, ...);
obj element;
...;
Count —
arrayCount(element);
obj element;
Delete —
void Delete(start, end);
int start;
int end;
Find —
int Find(element);
obj element;
Index —
int Index(elementName);
string elementName;
Insert —
void Insert(pos, elementN, ...);
int pos;
obj elementN;
...;
Reverse —
void Reverse();
SetDim —
void SetDim(newDim);
int newDim;
Sort —
void Sort( | mode, | |
| compareFunc, | ||
alg); |
| int | mode; |
| string | compareFunc; |
| int | alg; |
Sorts elements in array
Parameters
Determines the order of the array after the sort. Possible values can be constant.array.asc and constant.array.desc (default is constant.array.asc)
If this parameter is "" or not specified, the sort is performed executing a comparison operator for the class type of the array elements. Otherwise, if this parameter is specified, the function with the given name will be called to compare elements of array. The prototype of the function (callback) must be:
function boolean CompareFunc(array *theArray, int index1, int index2, int mode);
The array, two indexes and the mode (asc or desc) will be passed. The function must return:true if elements must be swapped, false if not.
Determines the sort algorithm. Possible values can be constant.array.bubble and constant.array.shell. If it is not specified, shell is used if elements are more than 20, bubble otherwise.
SubArray —
arraySubArray(start, end);
int start;
int end;
Return a portion of the array from start to end
Parameters
The first element to include in result array
The last element to include in result array
Causes error.array.ErrBadStartIndex if start parameter is less than or if it is greater than the dimension of the array. If start is 0, than the sub array begins with the first element of the array. Causes error.array.ErrBadEndIndex if end parameter is less than 0. If end is 0, than the sub array ends with the last element of the array.
ToString —
string ToString( | separator, | |
alsoName); |
| string | separator; |
| boolean | alsoName; |
Table of Contents
home —
string home
maxUsers —
int maxUsers
The MAX_USERS parameters specifies the maximum number of simultaneous connections supported by Biferno. The default value for this parameter is 32 on Unix and Windows, while on Mac OS Classic it depends on the Web server configuration. The maximum value is 10000 (ten thousand).
The property is only read
In most cases the default value of this parameter allows to obtain optimal performances from Biferno. We advise to make modifications only if strictly necessary based on the number of accesses required and on the amount of RAM available on the server.
This value can be modified using the line:
MAX_USERS n
in the file "biferno.conf" in BifernoHome
os —
string os
poolFactor —
int poolFactor
The POOL_FACTOR parameter determines the amount of RAM pre-allocated by Biferno for its internal data structures. The default value for this parameter is 1 and the maximum value is 10 (ten). The total amount of RAM used by Biferno is proportional to the number of simultaneous users (MAX_USERS) and to the value of the POOL_FACTOR parameter.
The property is only read
In most cases the default values of this parameter allows to obtain optimal performances from Biferno. We advise to make modifications only if strictly necessary based on the number of accesses required and on the amount of RAM available on the server.
This value can be modified using the line:
POOL_FACTOR n
in the file "biferno.conf" in BifernoHome
versionNum —
unsigned versionNum
Can be useful to analyze the number using the Hex method of number, as in: biferno.versionNum.Hex(): $biferno.versionNum.Hex()$
In this case only the last 3 couples of char the relevant.
Table of Contents
Table of Contents
Table of Contents
cacheItem —
void cacheItem( | path, | |
| openMode, | ||
permission); |
| string | path; |
| int | openMode; |
| int | permission; |
The class "cacheItem" extends the file class and can be used to manage files in cache. To activate the cache the application variable "CACHE" must be true
Parameters
n.a.
n.a.
n.a.
hits —
unsigned hits
Table of Contents
char —
void char(str);
string str;
The class "char" describes mono character strings. It inherits all methods and properties of string class.
Parameters
n.a.
Table of Contents
classInfo —
The classInfo class.c
Implemented in the C language.
classInfo —
void classInfo( | className, | |
extended); |
| string | className; |
| boolean | extended; |
GetErrorDescription —
string GetErrorDescription(error);
int error;
IsDef —
boolean IsDef( | className, | |
allTypes); |
| string | className; |
| boolean | allTypes; |
static method used to check if a class is defined
Parameters
the name of the class you want to check for existence
if true check also if, generally, an extension exists with that name. Note that an extension declaring only functions doesn't exist as a class, so this is the only way to check for them.
cloneIsNeeded —
boolean cloneIsNeeded
Classes like file or db, whose objects are connected to resources that are external to Biferno, when duplicated, duplicate also the connection to the external resource (file or database).
This poses a risk of opening the same file multiple times or to unnecessarily increase the number of open connections to the same database, which is at best a waste of resources and may have unforeseen consequences.
It is possible to inquire if a class "clones" its objects (as the file and database classes do) using this property
extendedClass —
string extendedClass
implem —
int implem
This property is used to check if the class is "predefined" (written and compiled in C) or "user" (local or application).
persistentAllowed —
boolean persistentAllowed
Persistent variables can not be instantiated for some predefined classes (e.g. this is not possible for the db and file classes). Also, it is not possible to create persistent variables for user defined classes. This property can be used to query the ability of a class to support persistent variables.
sourcePath —
string sourcePath
wantDestructor —
boolean wantDestructor
This property always returns true for user classes, because such classes always have a destructor (an internal one if the user has defined none), which frees memory resources allocated by Biferno to manage the class instance.
The value of this property for predefined classes depends on the implementation of the class itself.
Only read property
biferno —
int biferno
Table of Contents
GetIndSID —
string GetIndSID(index);
int index;
Used to retrieve the index-th Biferno SID (Session ID) active in a certain moment.
If the index is greater than all users en empty string is returned, so one can use code like:
index = 1
while(sid = client.GetIndSID(index++))
{
$client.SessionVariable(sid, "mylogin")
}
Parameters
The index of the SID to be returned (1-based)
SessionVariable —
string SessionVariable( | SID, | |
name); |
| string | SID; |
| string | name; |
Given a SID (Session ID) the value of the variable name for the user identified by SID is returned (see example in client.GetIndSID)
Parameters
the string containing the SID of the user
the name of the variable requested
address —
string address
If the web server has the "Reverse DNS lookup" off, this is simply the IP number of the client (the same of property.client.ipAddress)
Only read property
Table of Contents
curApp — Porvides informations about current app
The curApp class.c
Implemented in the C language.
Flush — Flush the cache
void Flush();
This method flushes also the cache af all children applications. To know which are the children application use curApp.children
GetPubVariable —
obj GetPubVariable( | application, | |
| scope, | ||
name); |
| string | application; |
| string | scope; |
| string | name; |
To access the value of a variable published by another applicationuse the function GetPubVariable. The name of the application that published the variable, as well as the scope and name of the published variable, must be specified. The function returns a copy object of the published variable, and therefore modifications of the returned variable have no effect on the original variable.
Parameters
the application the variable we are requesting belongs to
the scope of the variable as a string. Possible values are "application", "session" or "persistent"
the name of the variable
If the application doesn't exist the error Err_NoSuchApplication is throwed.
If the application exists but has not such a variable the error Err_VariableNotDefined is throwed.
If the application exists but has never published the variable the error Err_VariableNotPublished is throwed.
If the user is not sure if the variable exists (or if it has not yet been published) he can wrap the code between error.Resume and error.Suspend calls in order to avoid stop of the script, as in:
error.Resume()
if (a = curApp.GetPubVariable("anApp", "session", "aVar"))
...
error.Suspend()
Publish — Makes a variable visible to other apps
void Publish(varToPublish);
obj varToPublish;
Biferno has a mechanism that makes it possible for an application to access variables with application, session, or persistent scope belonging to another application.
The Publish predefined function makes a variable visible to all active applications. Only variables with application, persistent or session scope can be published. E.g. we can write:
application aWebMasterName = "John Smith" Publish(aWebMasterName)
Parameters
the variable to publish
Other applications can use curApp.GetPubVariable to get the value af a published variable.
Only variable of type application, session or persistent can be published
RegisterNewApp — Initializes an application
void RegisterNewApp( | applName, | |
fullPath); |
| string | applName; |
| string | fullPath; |
This method initializes another application executing also the Biferno.config.bfr of that application. If the application is already initialized this method just does nothing.
Parameters
the name of the application
the physical path of the folder containing the application. A file Biferno.config.bfr must exists in this folder
To start an application when the Web server is started, without waiting for the first user click, it is possible to use a code line similar to the following in the "Biferno.config.bfr" file of the Biferno Main application:
curApp.RegisterNewApp(application_name, root_path)
application_name is the name of the application we want to initialize (defined by the APPLICATION_NAME parameter of the "Biferno.config.bfr" file) and root_path is the absolute path of the application root directory. An example is:
curApp.RegisterNewApp("MyWebSite", "file://C/Internet/Web/MySite/")
Reload — Reload the application
void Reload();
Calling this method the current application is reloaded. All files in cache are unloaded and the application is reinitialized with all his application and session variable.
This method executes reload also on all children applications. Use curApp.children to know which are the children application.
Unpublish — Undoes a Publish call
void Unpublish(varToUnpublish);
obj varToUnpublish;
children — List of subapplication
string[] children
If we create a configuration file in a subdirectory of an application we have created a subapplication (or children).
Subapplications inherit as default the preferences of the parent application (the parent configuration file is executed before the child application configuration file). All applications running on the same Web server are subapplications of the "BifernoMain" application.
Only read property
Table of Contents
curFile — Provides informations about the current file in process
The curFile class.c
Implemented in the C language.
This class is useful to get some infos about the current file being processed.
It is important to understand the difference between script and file. In fact a script can comprise one file, or many files if it use the include command. To get informations about the current script use the class curScript.
Table of Contents
curScript — Get/Set infos about the current script
The curScript class.c
Implemented in the C language.
GetCustomOutput — Custom output function name
string GetCustomOutput();
GetIndVariable — Get variables list of current script
obj GetIndVariable( | index, | |
| name, | ||
| sorted, | ||
| scope, | ||
stackIndex); |
| int | index; |
| ref | name; |
| boolean | sorted; |
| string | scope; |
| int | stackIndex; |
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
the index of the variable in the list
on output, the name of the variable requested
specifies if the list must be sorted alphabetically, before getting the index-th variable
defines the list to get the variable from. Possible lists corresponds to possible scopes: local, global, application, session, persistent
n.a.
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).
GetIndVariableRef —
obj GetIndVariableRef( | index, | |
| name, | ||
| sorted, | ||
| scope, | ||
stackIndex); |
| int | index; |
| ref | name; |
| boolean | sorted; |
| string | scope; |
| int | stackIndex; |
GetNumFormat — Get the current decimal and thousand separators
void GetNumFormat( | thousSep, | |
decimSep); |
| ref | thousSep; |
| ref | decimSep; |
GetTotVariables — Total variables of current script
int GetTotVariables( | scope, | |
stackIndex); |
| string | scope; |
| int | stackIndex; |
The GetTotVariables returns the total number of variables in the "list" of current script variables.
"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
defines the list of variables. Possible lists corresponds to possible scopes: local, global, application, session, persistent
n.a.
IsDef — Checks if a variable is defined
boolean IsDef(name);
string name;
If we need to know if a variable is defined or undefined, we can use the method IsDef. This method requires a string called name as a parameter and returns the true value if a variable with identifier name exists, or false if no variable with identifier name exists. Example:
if (curScript.IsDef("myVar"))
print(myVar)
Parameters
the name of the variable to check
Notice that the IsDef function, unlike Undef, does not take an object as parameter, but rather a string containing the object name. This avoids an error condition if the variable has never been defined. In the case of the Undef function, an error condition should occur, because it is not legal to invoke Undef on an undefined object.
LaunchProcess — Launch a process from the current script
boolean LaunchProcess( | executablePath, | |
| commandLineString, | ||
| waitEnd, | ||
timeout_ms); |
| string | executablePath; |
| string | commandLineString; |
| boolean | waitEnd; |
| unsigned | timeout_ms; |
This method can be used to execute a process on the same computer where Biferno is running.
Parameters
a string containing the path of the executable file. This can be, for example, a ".exe" on Windows or an executable command on Unix. The path must be in Biferno file format, NOT native format
parameter arguments to pass to the executabel (as if written on a command line). If commandLineString contains path, they must be expressed in native format
if true, the call blocks until the called process is terminated, or until a timeout (timeout_ms) is reached. If false the call is not blocked and timeout is not used
if the call wait for the process to terminate, a timeout (in milliseconds) can be set to prevent infinite blocks.
SetCustomOutput — Installs function for redirecting script output
void SetCustomOutput( | outputFunction); |
| string | outputFunction; |
This method can be used to install a custom "callback" output: after this call, when the print command (or $$ or $$...$$ commands) are invoked the function "outputFunction" is called instead of the simple "print".
The custom function must have the following prototype:
function void myFunc(string text)
and remains installed only during the current script
Parameters
the name of the custom function
Example:
function void PrintRed(string text)
{
print('<font color="red">')
print(text)
print('</font>')
}
curScript.SetCustomOutput("PrintRed")
the above code causes all output strings to be printed in red text color.
To reinstall the default output function ("print") call the method SetStandardOutput
SetNumFormat — Specify decimal and thousand separators for current script
void SetNumFormat( | thousSep, | |
decimSep); |
| char | thousSep; |
| char | decimSep; |
The SetNumFormat static method allows to specify for a single current script within an application the decimal and thousand separators to be used during string conversion, temporarily replacing the application defaults defined in the “Biferno.config.bfr” file (THOUSAND_SEP and DECIMAL_SEP).
The following example clarifies its use:
a = 1234.567 // a is of classe double
b = a.ToString() //b is "1234,57" – notice rounding
c = a.ToString(true) //c is "1.234,57"
d = a.ToString(true, 1) //d is "1.234,6"
int.SetFormat(",",".")
e = a.ToString(true, 5) //e is "1,234.567"
f = a.ToString(true, 5, false) //f is "1,234.56700"
Parameters
the new thousand separator character
the new decimal separator character
SetStandardOutput — Restores default output function
void SetStandardOutput();
Undef — Deletes a variable
void Undef(variable);
obj variable;
Requires as a parameter an object identifier, i.e. a variable belonging to any class. The supplied object is made undefined and it will behave from now on as if it was have never defined. The Undef method returns void.
Undef(myVar)
Parameters
the variable to delete
Notice that the IsDef function, unlike Undef, does not take an object as parameter, but rather a string containing the object name. This avoids an error condition if the variable has never been defined. In the case of the Undef function, an error condition should occur, because it is not legal to invoke Undef on an undefined object. To validate the parameter to Undef, a code fragment code similar to the following can be used:
if (IsDef("myVar"))
Undef(myVar)
The Undef function cannot be used on “literal” variables or on the result of an operation. The code fragments:
Undef("foo") // error Err_IllegalUndef!
and
Undef(a + b) // error Err_IllegalUndef!
both generate the Err_IllegalUndef error.
ValueOf — Evaluates a single line of code
obj ValueOf(line);
string line;
This method evaluates a line of code. It can be, for example, a simple name of a variable or a more complex line
Parameters
the line to evaluate
basePath — The base path of the current script
string basePath
currentThreads —
int currentThreads
Why does Biferno (sometimes) use more than one thread per script?
When a script execution is requested Biferno spawns a thread with a predefined stack size (for C internal variables). The stack size is usually big enough to execute the entire script. Nevertheless some scripts (for example scripts using recursive functions) could need more stack at a certain point of execution. In that case the next block of code is executed in a new thread (joined to the parent) in order to obtain more stack space for execution. Thus the number of threads per script can also be greater than 1.
timeout — The timeout of the script
unsigned timeout
Get this property to know wich is the current timeout for the script. Set the property to modify that value for the current script
If the execution time of the script exceeds the value of curScript.timeout an error Err_Timeout is thrown. This eliminates the risk of possible endless loops in the code. To avoid timeout at all set timeout to 0 (zero). Note, however, that this removes protection from possible infinite loops.
The following code exits with error Err_Timeout after 1 minute:
curScript.timeout = 1 i = 1 while(i);
The default value for timeout is defined by application variable TIMEOUT and default value for this variable is 2 minutes.
Table of Contents
db —
void db(initString, db);
string initString;
string db;
This class is used to interact with database manager systems (DBMS). It can connect to DBMS via ODBC or via native drivers (when they are available).
Parameters
The string to connect to the database. The sintax of this string depends on the db parameter. For example a possible string for odbc connection is "DSN=MYDB;UID=mydbuser;PWD=myPass"
the type of connection used ("odbc", "mysql" etc...)
Bind —
void Bind( | pos, | |
| variableName, | ||
| bytes, | ||
| mode, | ||
cursorID); |
| int | pos; |
| string | variableName; |
| int | bytes; |
| int | mode; |
| int | cursorID; |
Binds a variable to the pos-th parameter mark ("?") in a prepared statement
Parameters
The position of parameter mark to bind
The name of the variable to bind
The size (in bytes) of the variable to bind
Specify if the variable has to be bound in input, output or inputOutput mode. Output mode is usefull for stored procedures. Possible costant to use are db.inputBindMode, db. outputBindMode , db. inputOutputBindMode
the cursor id to which apply Bind
BindAll —
void BindAll( | pos, | |
| variableName, | ||
| bytes, | ||
| mode, | ||
prepareID); |
| int | pos; |
| string | variableName; |
| int | bytes; |
| int | mode; |
| int | prepareID; |
Binds a variable to the pos-th parameter mark ("?") in a prepared statement in all statements of a prepared pool of cursors
Parameters
The position of parameter mark to bind
The name of the table field used with the parameter mark
The name of the variable to bind
The id of the pool as returned by a Prepare call
n.a.
Escape —
string Escape(str);
string str;
Exec —
int Exec( | sql_statement, | |
| mode, | ||
| rowSetSize, | ||
freeCursor); |
| string | sql_statement; |
| int | mode; |
| int | rowSetSize; |
| boolean | freeCursor; |
Sends to the DBMS the sql query contained in the sql_statement parameter.
Parameters
The string containing the sql statement to execute. Parts of the string must be escaped (with method.db.Escape method) if contain single quote character ("'").
The type of cursor result of the operation. Possible types are: db.dynamicMode: the cursor is dynamic, data is retrieved from the DBMS in multiple requests db.staticMode: the cursor is static, data is retrieved from the DBMS in a single request db.defaultMode: best mode is choosen by the driver
The number of rows requested at every Fetch in order to cache records returned by the DBMS
If this parameter is set to true, the cursor is disposed before returning from Exec
When the generic error error.db.ErrDBMSError is returned the real error is contained in the property.error.subErr and property.error.subErrDescr properties of global err error.db.ErrBadCursorMode is returned if an invalid cursor mode is passed to the function
ExecPrepared —
void ExecPrepared(cursorID);
int cursorID;
FetchRec —
arrayFetchRec( | cursorID, | |
| undefNULL, | ||
fetchLocator); |
| int | cursorID; |
| boolean | undefNULL; |
| boolean | fetchLocator; |
Fetches the next record from the current selection
Parameters
The id of the cursor
Normally NULL fields are retrieved as empty strings and one cannot distinguish between empty cells and NULL cells. If undefNULL is true, NULL field are retrieved as undefined elements of the array.
If true, the locators are fetched for CLOB/BLOB fields instead of the data. They can then be used with methods LobRead and LobWrite of class db. As of today only the oracle extension takes into account the value of this parameter.
An associative array containing cells of retrieved records. Element's index names of the array are equal to field title as referenced in the sql statements.
GetAffectedRecs —
int GetAffectedRecs(cursorID);
int cursorID;
Gets the number of records affected by the statement of the cursor cursorID
Parameters
Is the index of the cursor as returned by method.db.Exec, method.db.GetPrepared call. If cursorID is not passed, the last cursor created is used
GetCurRecs —
int GetCurRecs(cursorID);
int cursorID;
Gets the number of records contained in the selection pointed to by cursor cursorID
Parameters
Is the index of the cursor as returned by method.db.Exec, method.db.GetPrepared call. If cursorID is not passed, the last cursor created is used
GetPrepared —
int GetPrepared(prepareID);
int prepareID;
LobRead — Reads a portion of a LOB/FILE, as specified by the call, into a string.
string LobRead( | locator, | |
| offset, | ||
len); |
| int | locator; |
| int | offset; |
| int | len; |
This function can be used to read a portion (or all) of a LOB field.
Parameters
A LOB/FILE locator that uniquely references the LOB/FILE. This locator can be obtained calling the Fetch method with third parameter to true.
The absolute offset from the beginning of the LOB value. For character LOBs (CLOBs, NCLOBs) it is the number of characters from the beginning of the LOB, for binary LOBs/FILEs it is the number of bytes. The first position is 1.
The length in bytes (or characters) to read from the LOB field..
LobWrite — Writes a string into a LOB
void LobWrite( | locator, | |
| content, | ||
offset); |
| int | locator; |
| string | content; |
| int | offset; |
This function can be used to write a string into a portion (or all) of a LOB field.
Parameters
A LOB/FILE locator that uniquely references the LOB/FILE. This locator can be obtained calling the Fetch method with third parameter to true.
The string to write into the LOB field
It is the absolute offset from the beginning of the LOB value. For character LOBs it is the number of characters from the beginning of the LOB, for binary LOBs it is the number of bytes. The first position is 1.
Prepare —
int Prepare( | sql_statement, | |
| totPrepared, | ||
| mode, | ||
rowSetSize); |
| string | sql_statement; |
| int | totPrepared; |
| int | mode; |
| int | rowSetSize; |
Prepares totPrepared sql statements to be used later
Parameters
The statement to prepare. Usually this string contains "?" chars indicating parameter marks substituted at bind time
The total number of cursors to prepare
The mode of prepared cursor (see method.db.Exec)
The row set size of the cursor (see method.db.Exec)
RealEscape —
string RealEscape( | str, | |
byteEsc); |
| string | str; |
| boolean | byteEsc; |
Seek —
void Seek(index, cursorID);
int index;
int cursorID;
SetSpecific —
void SetSpecific( | name, | |
| value, | ||
cursorID); |
| string | name; |
| string | value; |
| int | cursorID; |
Tell —
int Tell(cursorID);
int cursorID;
dynamicMode —
int dynamicMode
staticMode —
int staticMode
ErrBadCursorMode —
int ErrBadCursorMode
Is returned when a cursor mode other than db.dynamicMode, db.staticMode, db.defaultMode is passed to method.db.Exec and method.db.Prepare db methods.
ErrDBMSError —
int ErrDBMSError
Is a generic error indicating that an error at driver level occurred. See property.error.subErr and error.subErrDescr of global err to investigate.
Table of Contents
double — 8-bytes floating point number
The double class.c
Implemented in the C language.
double — Creates an object of class double
void double(num);
obj num;
Can return Err_IllegalTypeCast if the num parameter cannot be typecasted to a valid floating point number
ToString —
string ToString( | wantThousandSep, | |
| decimals, | ||
cutRightZero); |
| boolean | wantThousandSep; |
| int | decimals; |
| boolean | cutRightZero; |
Convert the number in a string
Parameters
If true the thousand separators are inserted in the string. Thousand separator character can be defined using SetNumFormat or using the THOUSAND_SEP application variable
Indicates how many digits to put after the decimal sign (default is 2)
If true the zero characters after the last non-zero char after the decimal point will be removed
Table of Contents
error —
void error( | theError, | |
| theSubError, | ||
class); |
| int | theError; |
| string | theSubError; |
| string | class; |
Describes an object representing a Biferno error.Usually biferno initializes a global variable named "err" in every script. If an error occurs that variable is set automatically to the error, than the execution of the script is stopped, unless method.error.Resume is set.
Parameters
The number of the error
The number of the sub error if theError parameter indicates a family of errors (i.e. "Err_OSError")
If the error is a class error, the name of the class
ThrowException —
void ThrowException( | errNum, | |
class); |
| int | errNum; |
| string | class; |
subErr —
string subErr
subErrDescr —
string subErrDescr
Err_MultipartObjectDuplicated —
int Err_MultipartObjectDuplicated