Tuesday, September 28, 2010

Format expression rules

A format expression for strings can have one section or two sections separated by a semicolon (;).
If you use The result is
One section only The format applies to all string data.
Two sections The first section applies to string data, the second to Null values and zero-length strings ("").
A user-defined format expression for numbers can have from one to four sections separated by semicolons. If the format argument contains one of the named numeric formats, only one section is allowed.

If you use The result is
One section only The format expression applies to all values.
Two sections The first section applies to positive values and zeros, the second to negative values.
Three sections The first section applies to positive values, the second to negative values, and the third to zeros.
Four sections The first section applies to positive values, the second to negative values, the third to zeros, and the fourth to Null values.



read moe

File related variables

These variables are used with WF and DF commands. In all other cases their values are ignored by WhizBase.
WB_FileName - This variable contains the file name of the DF (file will be deleted) and WF (key value will be written in file).
WB_KeyName - This variable contains the name(s) of the key(s) that will be changed/added/deleted using WF.
WB_KeyValue - This variable contains the value(s) for the key(s) that will be changed or added using WF.
WB_Section - This variable contains the name of the section containing the key that will be changed/added/deleted using WB_Command value WF.
WB_Separator - This variable contains the character which will be used to separate different entries in the WB_Keyname and WB_KeyValue variables.

read more

FileCommands

Syntax:FileCommands=On/Off
If this variable is set to True, WhizBase will process files that include writing and/or deleting files on server. It is strongly recommended not to set this variable to True together with AbsolutePath set to true, unless webmaster of virtual server is an experienced WhizBase developer. Default value is Off.

Example of use

FileCommands variable is used in Server configuration section, a configuration is set for all aliases of a single virtual host.
[wbsp.com]
DisableWB=F
AbsolutePath=On
Upload=On
FileCommands=On
Execute=JavaScript,VBScript,JScript
HiddenEnvVars=PATH,COMP*,System*
TimeOutSec=20
DefaultDocument=index.wbsp
ADOConnectionString=T
ActivateCGIByExt=wbsp
CGISecurityString=LhBv3KP
MaxInstances=0
HideDocuments=sr,aut,inc,ic,mdb
ScriptTimeOutSec=60

[dsd.ba]
DisableWB=F
AbsolutePath=Off
Upload=On
FileCommands=Off
Execute=VBScript
HiddenEnvVars=PATH,COMP*,System*,Win*
TimeOutSec=10
DefaultDocument=default.wbsp
ADOConnectionString=F
ActivateCGIByExt=wbsp
CGISecurityString=LhBv3KP
MaxInstances=10
 

FDT ($WBFN)

Availability
FDT is available for use with all WBSP commands.
Syntax

$WBFN[FDT(formatstring)]

Arguments
formatstring - any valid named or user-defined format string.

Returns
Current server date or time (depending on value of formatstring argument) formatted using formatstring.
Example


Today is $wbfn[fdt(dd-mmmm-yyyy)]!

Result
Today is 07-july-2008!

Execute

Execute=languagelist
This variable contains the comma-separated list of scripting languages that are allowed to be used on the virtual server. If this variable is empty then server-side scripting functionality of WBSP engine (using $wbrun function) will be disabled on that virtual host. There is no default value for this variable, so if administrator does not set the list, scripting will be disabled.
The next example will show usage of Execute in WBSP:
[default]
DisableWB=F
AbsolutePath=Off
Upload=Off
FileCommands=Off
Execute=JavaScript
HiddenEnvVars=PATH,COMP*,System*,Win*
TimeOutSec=10
DefaultDocument=index.wbsp
ADOConnectionString=F
ActivateCGIByExt=wbsp
CGISecurityString=LhBv3KP
MaxInstances=30
HideDocuments=sr,ic,inc,aut,mdb,dbf

Monday, September 27, 2010

Exceptions

WhizBase function $WBINC can not accept other WhizBase functions as arguments, but there is a similar function - $WBRINC that can be used when you need to process the function's arguments.

read more

Error message tags

Error message tags are WBSP placeholders for various parts of an error message. They are not intended to be used on the ordinary WBSP pages nor in normal circumstances, but in error template file (defined by WB_ErrFile variable and sent to client when error occurs). Their purpose is to format and/or hide some of the error details. Also, when output type (Content-type) is not text/html they can be used to generate proper error report (e.g. XML, XHTML, WML, RTF, etc.)
$WBERRDESC - Full error description including error message and error number.
$WBERRMSG - Text-only error description without error number.
$WBERRNUM - Error number, without any text message.
$WBERRMAIL - Email address specified in WB_ErrMail form field for current WBSP file.

read more