Version 4.0
(Draft: 4.02, Date: 3/8/98)
Copyright Notice
Copyright © 1994-1998 TalentSoft - an operation of Talent Information Management, LLC. All rights reserved.
Web+ and the Web+ logo are trademarks of TalentSoft.
Microsoft is a registered trademark of Microsoft Corporation. Microsoft Internet Explorer, Windows NT, and Windows 95 are trademarks of Microsoft Corporation. Netscape and Netscape Navigator are trademarks of Netscape Communications Corporation. Pentium is a trademark of Intel Corporation. All other brand names and product names used in this book are trademarks, registered trademarks, or trade names of their respective holders.
No part of this manual may be reproduced or retransmitted in any form or by any means electronic, mechanical, or otherwise, including photocopying and recording for any purpose other than the purchaser's personal use without the written permission of TalentSoft.
TalentSoft welcomes any comments and suggestions regarding this document and the Web+ software.
TalentSoft / Talent Information Management, LLC.
Address: 900 Nicollet Mall, Ste. 700
Minneapolis, MN 55402, USA
Tel: (612) 338-8883
Fax: (612) 904-0010
Email: info@talentsoft.com
URL: http://www.talentsoft.com
Introduction *
Terms Used in This Manual
*Language Reference *
Data Types
*Number Type
*String Type
*Array Type
*Variable Assignment and Display
*<webSet> Tag
*<webPrint> Tag
*TreatedAsVar Function
*Math and Logical Functions
*<webEval> Tag
*Escape Function
*ArrayCount Function
*Abs Function
*If Function
*Int Function
*Rnd Function
*Log Function
*Exp Function
*Sin Function
*Cos Function
*DateDiff Function
*DateAdd Function
*WeekDay Function
*IsDate Function
*IsNumeric Function
*IsMasked Function
*UploadFile Function
*Environmental Information Functions
*NumSubmittedVars Function
*NumSubmittedUrlVars Function
*SubmittedName(no) Function
*SubmittedValue(no) Function
*CurrentPath Function
*Shared Variables
*<webDeleteVar> Tag
*webMkDir, webCurDir, webChDir, webRmDir Functions
*GetTempFileName Function
*CurrentDate Function
*CurrentTime Function
*CurrentDateTime Function
*FileTime Function
*webGetVersion Function
*CGI Environment Variables
*Web+ Server Configuration Functions
*webIniGet Function
*webIniPut Function
*<webIniRefresh> Tag
*Web+ Cache Technique
*String Processing Functions
*Asc Function
*Chr Function
*IsMasked Function
*LCase Function
*UCase Function
*LTrim Function
*RTrim Function
*Trim Function
*Len Function
*Left Function
*Right Function
*Mid Function
*InStr Function
*StrReplace Function
*Format Function
*DateFormat Function
*TimeFormat Function
*DatePart Function
*NumberFormat Function
*DecimalFormat Function
*DollarFormat Function
*YesNoFormat Function
*ParagraphFormat Function
*StripCR Function
*HTMLCodeFormat Function
*HTMLEditFormat Function
*ParameterExists Function
*PreserveSingleQuotes Function
*URLEncodedFormat Function
*ValueList Function
*QuotedValueList Function
*ListCount Function
*GetListElement Function
*ValidateCC Function
*Operator Precedence
*Operators
*^ Operator
** Operator
*/ Operator
*% Operator
*+ Operator
*- Operator
*Comparison Operators
*Comparison Operators: = Eq != Ne =$ EqS !=$ NeS Lt Gt Lte Gte ? Contain Contains !? NotContain
*Logical Operators
*&& And Operator
*|| Or Operator
*! Not Operator
*& String Concatenation Operator
*? Like Operator (replaces Contain)
*!? NotLike Operator (replaces NotContain)
*Flow Control Statements
*<webAbort> Tag
*<webIf> <webElseIf> <webElse> Tag
*<webSelectCase> <webCase> <webCaseElse> Tag
*<webFor> <webExitFor> Tag
*<webWhile> <webExitWhile> Tag
*<webContent> Tag
*<webLocation> Tag
*<webInclude> Tag
*<webCall> Tag
*Program Execution Statements
*<webRun> Tag
*<webRunFile> Tag
*<webRunScript> Tag
*<webDLL> Tag
*SMTP Mail Statements
*<webMail> Tag
*<webPopOpen> Tag
*<webPopRetrieve> Tag
*<webPopDelete> Tag
*<webPopReset> Tag
*<webPopClose> Tag
*File Processing Statements
*<webFileOpen> Tag
*<webFileClose> Tag
*<webFileCopy> Tag
*<webFileRename> Tag
*<webFileDelete> Tag
*<webFileGetChar> Tag
*<webFileGetLine> Tag
*<webFilePutChar> Tag
*<webFilePutLine> Tag
*<webGetProfile> Tag
*<webPutProfile> Tag
*<webPrint> Tag
*DefaultFileName Function
*Database Processing Statements
*CurrentRow Function
*<webDbInsert> Tag
*<webDbUpdate> Tag
*<webDbQuery> Tag
*<webDbQueryMore> Tag
*webDataSource Function
*<webDbTransaction> Tag
*<webDbRollBack> Tag
*<webPrint> Tag
*<webPrintTable> Tag
*<webPrintTableCol> Tag
*Cookie Statements
*<webCookie> Tag
*TCP/IP Communication Statements/Functions
*webGetConnection Function
*<webSocketOpen> Tag
*<webSocketClose> Tag
*<webSocketSend> Tag
*<webSocketReceive> Tag
*Encrypt Web+ scripts
*EncodeCC Function
*DecodeCC Function
*Custom Tags and COM/DCOM Objects
*<web_ChkMail Tag (Custom Tag Example)>
*<web_QueryIpHostName > Tag (Custom Tag Example)>
*<web_Print> Tag (Custom Tag Example)
*<web_Pager> Tag (Custom Tag Example, Unix and Linux Only)
*<webObject> Tag (ActiveX/OLE Automation Interface)
*Miscellaneous Statements
*IncrementValue Function
*DecrementValue Function
*webBeep Statement
*ClientDeleteVar Function
*ClientVarList Function
*ClientDeleteAllVars Function
*<webVarExistCheck> Tag
*<webAuthenticate> Tag
*<webCheck> Tag
*<webPGP> Tag
*<webCyberCash> Tag
*<webCounter> Tag
*<webSynchronized> Tag
*<webPushPage> Tag
*<webSleep> Tag
*<webReport> Tag
*<webClient> Tag
*Form Field Validation Suffixes
*Variable Manipulation
*Variables
*Resolving ambiguities in variable names
*Appendixes *
Appendix A - ANSI Character Set
*Appendix B - HTML Form Tags
*FORM Tag
*INPUT Tag
*SELECT & OPTION Tags
*TEXTAREA Tag
*HTML Form Tags Summary
*Index *
argumentlist
[ expression | parameter := expression ][, ...]A list of zero or more expressions that are assigned to the parameters of the subroutine, function or property.
A positional parameter may be skipped by omitting the expression. Only optional parameters may be skipped.
Positional parameter assignment is done with expression. Each parameter is assigned in turn. By name parameter assignment may follow.
By name parameter assignment is done with parameter := expression. All following parameters must be assigned by name.
Conditional expression
An expression that returns a numeric result. If the result is zero then the conditional is False. If the result is non-zero then the conditional is True.
Examples:
0 <!--- False --->
-1 <!--- True --->
#(X gt 20)# <!--- True if X is greater than 20 --->
#S = "hello"# <!--- True if S equals "hello" --->
expression
An expression that returns the appropriate result.
statement A single command.
Examples:
<webBeep>
name
An identifier that names a variable or a user defined subroutine, function or property. Identifiers start with a letter. Following characters may be a letter, an underscore, or a digit.Count
DaysTill2000
Get_Data
number
An expression that returns a numeric result.10236
3.14159
1.2E12
Count
Count - 1
InStr(S, "A")
parameter
[ [Optional] [ | ByVal | ByRef ] | parameterarray ] parameter[( )] [As type] An Optional parameter may be omitted from the call. It must be a Variant type. All parameters following an Optional parameter must also be Optional.
parameterarray may be used on the final parameter. It must be an array of Variant type. It must not follow any Optional parameters. The parameterarray receives all the expressions at the end of the call as an array. If LBound(parameter) > UBound(parameter) then the parameterarray didn't receive any expressions.
If the parameter is not ByVal and the expression is merely a variable then the parameter is a reference to that variable (ByRef). (Changing parameter changes the variable.) Otherwise, the parameter variable is local to the subroutine, function or property, so changing its value does not affect the caller.
Use parameter( ) to specify an array parameter. An array parameter must be referenced and can not be passed by value. The bounds of the parameter array are available via LBound( ) and UBound( ).
Property Get, Let and Set blocks do not allow Optional or parameterarray parameter types.
property An object provides methods and properties. Properties may be used as values (like a function call) or changed (using assignment syntax).
If the property name contains characters that are not legal in a name, surround the property name with [ ].
Example:
Cookie.[Last Visited]
statement Zero or more statements. A statement is at least one script line long. Do, For, If (multiline), Select Case, While, and With statements are always more than one line long. A single line statement continues on the next line if it ends a line with a space and an underscore ' _'
My
string
An expression that returns a string result.
stringvariable
A variable that holds one string value.Example:
FirstName
variable A variable holds either a string, a numeric value or an array of values depending on its type.
Example |
Description |
WEBP.EXE |
UPPERCASE letters indicate filenames, registers, and terms used at the operating system command level. |
<webSet #I# = #Rnd(2)# > |
Bold type indicates Web+ constants, functions, keywords, operators, language-specific characters. Within discussions of syntax, bold type indicates that the text must be entered exactly as shown. |
Expression |
Words in italics indicate placeholders for information you must supply, such as a filename. Italic type is also used occasionally for emphasis in the text. |
[option] |
Items inside square brackets are optional. |
Mode ="{Read|Write|Append}" |
Braces and a vertical bar indicate a choice among two or more items. You must choose one of these items unless square brackets ( [ ] ) surround the braces. |
<webSet #I# = 1 > |
Fixed spacing font (Courier New) is used for examples, user input, program output, and error messages in text. |
CL [option...] file... |
Three dots (an ellipsis) following an item indicate that more items having the same form may appear. |
While() { } |
A column or row of three dots tells you that part of an example program has been intentionally omitted. |
CTRL+ENTER |
Small capital letters are used to indicate the names of keys on the keyboard. When you see a plus sign (+) between two key names, you should hold down the first key while pressing the second. The carriage-return key, sometimes marked as a bent arrow on the keyboard, is called ENTER. |
"argument" |
Quotation marks enclose a new term the first time it is defined in text. |
"C string" |
Some C constructs, such as strings, require quotation marks. |
Variable |
A variable holds either a string, a numeric value or an array of values . |
Hyper Text Markup Language (HTML) |
The first time an acronym is used, it is usually spelled out. |
See Using Projects |
Hypertext cross-references are in green underlined text. |
CEnterDlg; |
The blue triangle adjacent to the blue code indicates that it has been altered from a previous example, usually because you are being instructed to edit it. |
Description
Number type includes: integer, decimal, real number.Syntax
<webSet #VariableName# = number>Remarks
In any math computation, Web+ only keeps 12 decimal places.See Also
Example
<!--- The following are equivalent, quotes are optional --->Description
Web+ strings are variable-length, which can contain up to approximately 64,000 characters (64 K) long. Sting type values must be enclused by double-quotes (").Syntax
<webSet #VariableName# = string>Remarks
Size limit, 64 K.See Also
Example
<!--- The following are equivalent, quotes are optional --->Description
An array is a set of sequentially indexed elements having the same type. Each element of an array has a unique index number that identifies it. Changes made to an element of an array do not affect the other elements..Syntax
Assigning a single value to an array index:Remarks
See Also
ArrayCount functionExample
<!--- The following are equivalent, quotes are optional --->Variable Assignment and Display
Description
Assigns the value of a constant or an expression to a variable.Syntax
<webSet #VariableName# = expression>Remarks
We have an abbreviation to set a variable to 1 or 0.To set to 1:
<webSet #VariableName#>
To set to 0:
<webSet #!VariableName#>
We can also set the expression in the variable without evaluation.
<webSet #VariableName#=Expression Eval=1 or 0>
This is useful in combination with <webEval ...>.
works within
<webPrint> ... </webPrint>.See Also
Example
<webSet #I# = 1 ><!--- You can use <webSet> to return the result of the comparison between two strings --->
<webSet #string1# = "webplus"><webSet #string2# = "webplus">
<webSet #samestring# = #string1 = string2#>
<webPrint>String Comparison Result = #samestring#</webPrint>
Web+Output:
String Comparison Result = 1
Description
Prints information based on the records returned by a query.Syntax
<webPrint> VariableName, Expressions </webPrint>Remarks
See Also
webPrint, webPrintTable in database sectionExample
<webPrint>
Description
Treats the value of the expression as a variable. It can be used inside a ValueList().Syntax
#TreatedAsVar (expression)#Remarks
This function can be used in place of a variable.See Also
Example
<webSet #Var1# = 14 ><webPrint>
#Var1#<br>
#TreatedAsVar("Var"&I)#<br>
</webPrint>
Web+ Output:
14
14
Description
Evaluates an expression and returns a value.Syntax
<webEval CodeVar=Variable Ret=Variable><webEval CodeFile=File Name=Exp Ret=Variable>
Remarks
works within <webPrint> ... </webPrint>.See Also
Example
<webSet #A# = "##(1+2)##"><webEval CodeVar=#A# Ret=#Z#>
<webPrint> A=#A# Z=#Z# </webPrint>
Web+ Output:
A= #(1+2)# Z=3
Description Returns the expression directly without evaluation.
.Syntax #Excape(exp)#
Remarks
None.See Also
Example #Escape(1+X*10)#
Description
Returns the number of items in an array.Syntax
#ArrayCount(name of the array)#
Remarks
See Also
Example
<webSet #A[]# = ",1,3,5,7,9,,13,,,19"><webFor #i# = 0 to 10>
<webSet #B[i]# = #Int(Rnd (2) * 100)#>
</webFor>
<webPrint>
Nbr of items in array A = #ArrayCount(A[])#
Nbr of items in array B = #ArrayCount(B)#
</webPrint>
Web+ Output:
Nbr of items in array A = 10
Nbr of items in array B = 11
Description
Returns the absolute value of a number..Syntax
#Abs(number)#
Argument |
Required |
Description |
Number |
Yes |
The argument number can be any valid numeric expression. The absolute value of a number is its unsigned magnitude. For example, ABS(-1) and ABS(1) both return 1. |
Remarks
See Also
Example
<webSet #Difference# = #Abs(X - Y)#>Description
Return a value if the logical_test evaluates to TRUE or a value if the logical_test evaluates to FALSE.Syntax
#If(logical_test, value_if_true, value_if_false)#
Argument |
Required |
Description |
Logical_test |
Yes |
The argument is either a value or an expression that can be evaluated to TRUE or FALSE. |
Value_if_true |
Yes |
If logical_test returns TRUE, value_if_true will be returned, otherwise, it will be omitted. |
Value_if_false |
Yes |
If logical_test returns FALSE, value_if_false will be returned, otherwise, it will be omitted. |
Remarks
See Also
Example
<!--- This example illustrates if name is equal to "Ann", then return Yes, else return No ---><webPrint> #If(Name="Ann", "Yes", "No")# </webPrint>
Web+Output:
Yes
Description
Return the integer portion of a number.Syntax
#Int(number)#
Argument |
Required |
Description |
Number |
Yes |
The argument number can be any valid numeric expression. Int removes the fractional part of number and return the resulting integer value. For example, Int(1.5) returns 1 and Int(-1.5) returns -1. |
Remarks
See Also
Example
<!--- This example illustrates how to calculate the difference between two numbers, X and Y --->
Description
Returns a random number greater than or equal to zero and less than one.Syntax
#Rnd(n)#
Argument |
Required |
Description |
N |
Yes |
Integer expression indicating the precision (number of digits/decimal places) to return. The integer must be between 1 and 12. If n is greater than 12, the function only returns the first 12 digits and the rest are truncated. |
Remarks
See Also
Example
<!--- This example illustrates how to generate a random integer number between 0 and 10 --->Description
Compute the log value under a particular base.Syntax
#Log(Value[,Base])#
Remarks
See Also
Example
#Log(123,3)#Description The exp function returns the exponential value of the floating-point parameter
.Syntax
#Exp(value)#Remarks
See Also
Example
#Exp(20.0)#Description Returns the sine of VarName
.Syntax
#Sin(value)#Remarks
See Also Cos
Example
#Sin(3.141526/2)#Description Returns the cosine of VarNaem
.Syntax
#Cos(value)#Remarks
See Also Sin
Example
#Cos(3.1415926/2)#Description
Returns a number containing the number of time intervals between two specified dates.Syntax
#DateDiff(interval, startdate, enddate)#
Argument |
Required |
Description |
Interval |
Yes |
String expression that is the interval of time you use to calculate the difference between startdate and enddate. The interval to be modified ("m", "d", "h", "n","s"). |
Startdate |
Yes |
The starting date for calculation |
Enddate |
Yes |
The ending date for calculation |
You can use the DateDiff function to determine how many specified time intervals exist between two dates. For example, you might use DateDiff to calculate the number of days between two dates or the number of hours between now and the last update time.
The following table lists the valid time periods and their interval values.
These intervals are also used by the Format function.
Interval Label |
Available |
Time Period Description |
Yyyy |
No * |
Year |
Q |
No * |
Quarter |
M |
No * |
Month |
Y |
No * |
Day of year |
D |
Yes |
Day |
W |
No * |
Weekday |
Ww |
No * |
Week |
H |
Yes |
Hour |
N |
Yes |
Minute |
S |
Yes |
Second |
* These labels are not yet all available in Web+ 4.0, but will be in future versions.
If you want to know the number of days between startdate and enddate, you can use either Day or Hour ("d" or "h").
When interval is Weekday ("w"), DateDiff returns the number of weeks between the two dates. If startdate falls on a Monday, DateDiff counts the number of Mondays until enddate. It counts startdate but not enddate. If interval is Week ("ww"), however, the DateDiff function returns the number of calendar weeks between the two dates. It counts the number of Sundays between startdate and enddate. DateDiff counts startdate if it falls on a Sunday; but it doesn't count enddate, even if it does fall on a Sunday.
If startdate refers to a later point in time than enddate, the DateDiff function returns a negative number.
Remarks
See Also
Example
<!--- This example illustrates the day difference between the current date time and 1996-06-06 13:02:54 --->#DateDiff("d", CurrentDateTime(),1996-06-06 13:02:54)#>
Description
Returns a date string based on the initial date, but modified as specified date.Syntax
#DateAdd(interval, number, date)#
Argument |
Required |
Description |
Interval |
Yes |
The interval to be modified ("yyyy", "m", "d", "h", "n","s"). |
Date |
Yes |
The "base" date/time string. |
Number |
Yes |
The degree to which the internal is to be modified. |
Remarks
See Also
Example
<webset #newDate# = #DateAdd ("d" , 1 , currentDateTime())#><webset #newDate# = #dateAdd("n" , -10 , currentDateTime())#>
Description
Returns an integer between 1 (Sunday) and 7 (Saturday) that represents the day of the week for a date argument.Syntax
#Weekday(dateexpression)#
Argument |
Required |
Description |
Dateexpression |
Yes |
The dateexpression can be any string expression that can represent a date and/or time from January 1, 1970 through Decemeber 31, 9999, where January 1, 1900 is 2. Results of Weekday function: Sunday = 1 If dateexpression is Null, Weekday function will return a Null. If dateexpression is an invalid date, Weekday function will return 0. |
Remarks
See Also
TimeFormat, FormatExample
<webPrint>#WeekDay("January 1, 1990")#</webPrint>Description
Returns the value 1 when the expression can be converted to a date, otherwise, returns 0.Syntax
#IsDate(expression)#
Argument |
Required |
Description |
Dateexpression |
Yes |
expression can be any string expression that can represent a date and/or time from January 1, 1970 through December 31, 9999. If expression is Null, IsDate will return a Null. |
Remarks
See Also
TimeFormat, WeekDay, CurrentDate()Example
<webPrint>#IsDate(CurrentDate())#</webPrint>Web+Output: 1
Description
Returns the value 1 when the expression can be converted to a numeric data type, otherwise, returns 0.Syntax
#IsNumeric(expression)#
Argument |
Required |
Description |
Expression |
Yes |
The expression can be any string expression or numeric constant. |
Remarks
See Also
Example
<webPrint>#IsNumeric(3)#</webPrint>Web+Output: 1
Description
Returns the value 1 when the mask follow the same format with the input field's mask., otherwise, returns 0.Syntax
#IsMasked (expression)#
Argument |
Required |
Description |
Expression |
Yes |
The expression can be any string expression or numeric constant. |
StringMask |
Yes |
Any string mask. This is the same as the _masked defined in the form field validation section. |
Remarks
See Also
Example
<webPrint>#IsMasked("123.123.123.1", "?.?.?.?")#
</webPrint>
Web+Output: 1
Description
Gets the logical file name and uploads the file on the Web+ server machine.Syntax
#UploadFile (userfile)#Remarks work within
<webPrint> ... </webPrint>Example
<!--- Upload the file to the server ---><webIf #ParameterExists(Done)#>
Uploading File Name: <webPrint>#UploadFile(userfile)#</webPrint>
<webAbort>
</webIf>
<FORM ENCTYPE="multipart/form-data" METHOD="POST" ACTION="upload.wml">
<INPUT TYPE=FILE NAME=userfile>
<INPUT TYPE="Submit" NAME="Done" VALUE="Submit">
</FORM>
Environmental Information Functions
returns the number of url and form variables sent to Web+ server.
returns the number of url variables sent to Web+ server.
returns the the no-th submitted variable's name.
For example #SubmittedName(2)#
gives out the second submitted variable's name.
return the no-th submitted variable's value.
For example #SubmittedValue(2)#
gives out the second submitted variable's value.
Note: NumSubmittedVars and NumSubmittedURLVars.
All the URL variables will have lower indexes than the form variables, so
that #SubmittedName (1)# ... #SubmittedName (NumSubmittedURLVars())# will
return the names of the URL vars, and #SubmittedName
(NumSubmittedURLVars() + 1)# ... #SubmittedName (NumSubmittedVars())#
will return the names of the form vars. SubmittedValue (n) returns the
value of the variable named by SubmittedName (n).
To print all the variables submitted to a script, you could do:
<ol>
<webFor #i# = 1 to #NumSubmittedVars()#>
<li>#SubmittedName(i)#=#SubmittedValue(i)#
</webFor>
</ol>
Description
Returns the current path of the script.Syntax
#CurrentPath()#Remarks
See Also
Example
<webPrint>The current script path is: #CurrentPath()#
</webPrint>
Description
When a variable is shared, it is global and can be modified by other scripts.Syntax
Remarks
See Also
Example
<webSet #shared.X# = "Test"><webPrint>
shared.X = #shared.X#
</webPrint>
Description
Delete shared, client or local variables.Syntax
<webDeleteVar VarName>Remarks
works within <webPrint> ... </webPrint>.Pls note here VarName should be within # ... #.
See Also
Example
<webSet #xy# = 123><webDeleteVar #xy#>
Or:
<webSet #Shared.xy# = 111>
<webDeleteVar #Shared.xy#>
webMkDir, webCurDir, webChDir, webRmDir Functions
Description
webMkDir(), webChdir() and webRmDir() all need a path name as a parameter(either absolute or relative) and return TRUE or FALSE. WebCurDir() takes no parameter and returns the current working directory.Syntax
Remarks
See Also
Example
<webSet #dir# = "/test"><webIf #webMkDir(dir)#>
<webPrint>
Current Directory: #webCurDir#
</webPrint>
<webSet #null# = #webChDir("..")#>
<webSet #null# = #webRmDir(dir)#>
</webIF>
<webPrint>
Current Directory: #webCurDir()#
</webPrint>
Description
Returns the system level temp file name to be used for file i/o.Syntax
#GetTempFileName()#Remarks
Returns a temporary file name with logical path \temp\. So you have to predefine a Logical /temp/ path in the webpsvr.ini and a physical path. Please note, if the NT's environment variable TMP is set, then the temporary will be under the TMP's directory no matter what physical path you defined in the webpsvr.ini, and it will be in the physical path you defined if TMP is undefined.path.
See Also
Example
<webPrint>The temporary file name is: #GetTempFileName()#
</webPrint>
Description
Returns the current system date of the Web+ server.Syntax
#CurrentDate()#Remarks
See Also
CurrentTime(), CurrentDateTime()Example
<webPrint> Today's date is: #CurrentDate()# </webPrint>Web+Output:
Today's date is: 1997-02-24
Description
Returns the current system Time of the Web+ server.Syntax
#CurrentTime()#Remarks
See Also
CurrentDate(), CurrentDateTime()Example
<webPrint> The time now is: #CurrentTime()# </webPrint>Web+Output:
The time now is: 21:33:05
Description
Returns the current system date and time of the Web+ server.Syntax
#CurrentDateTime()#Remarks
See Also
CurrentDate(), CurrentTime()Example
<webPrint> Now is: #CurrentDateTime()# </webPrint> Web+ Output
Now is: 1997-02-24 21:33:05
Description
You can find the modified date/time of a file.Syntax FileTime(FileName, Method)
Argument |
Required |
Description |
FileName |
Yes |
Logical path and file name of the file(must be contained in double quotes) |
Method |
Yes |
Modified or Accessed |
Example <webPrint>#FileTime("/webplus/admin/admin.wml",
"Modified")#
</webPrint>
possible output: 01/22/1997 18:33:40
Remarks
The FileTime() function takes two parameters (a Web+ logical filename and a method) and returns the time when the file was last modified. The only valid method is currently ("Modified").Description
Get OS or Version of Client | Server .Syntax #webGetVersion()#
Example <webPrint>
ServerOS=#webGetVersion("ServerOS")#<BR>
ClientOS=#webGetVersion("ClientOS")#<BR>
ServerVersion=#webGetVersion("ServerVersion")#<BR>
ClientVersion=#webGetVersion("ClientVersion")#<BR>
Type=#webGetVersion("Type")#<BR>
</webPrint>
Output:
ServerOS=01 Windows NT (i86)
ClientOS=01 Windows NT
ServerVersion=4.0 Build 403
ClientVersion=4.0 Build 21
Type=1 Client/Server NT Servic
The following description of available CGI Environment Variables is taken from the NCSA CGI Specification (http://hoohoo.ncsa.uiuc.edu/cgi/interface.html).
In order to pass data about the information request from the server to the script, the server uses command line arguments as well as environment variables. These environment variables are set when the server executes the gateway program.
Variable |
Explanation |
SERVER_SOFTWARE |
The name and version of the information server software answering the request (and running the gateway). Format: name/version. |
SERVER_NAME |
The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs. |
GATEWAY_INTERFACE |
The revision of the CGI specification to which this server complies. Format: CGI/revision. |
SERVER_PROTOCOL |
The name and revision of the information protocol this request came in with. Format: protocol/revision. |
SERVER_PORT |
The port number to which the request was sent. |
REQUEST_METHOD |
The method with which the request was made. For HTTP, this "GET", "HEAD", "POST", etc. |
PATH_INFO |
The extra path information, as given by the client. In other words, scripts can be accessed by their virtual pathname, followed by extra information at the end of this path. The extra information is sent as PATH_INFO. |
PATH_TRANSLATED |
The server provides a translated version of PATH_INFO, which takes the path and does any virtual-to-physical mapping to it. |
SCRIPT_NAME |
A virtual path to the script being executed, used for self-referencing URLs. |
QUERY_STRING |
The information which follows the ? in the URL that referenced this script. This is the query information. |
REMOTE_HOST |
The hostname making the request. If the server does not have this information, it sets REMOTE_ADDR and leaves this unset. |
REMOTE_ADDR |
The IP address of the remote host making the request. |
AUTH_TYPE |
If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user. |
REMOTE_USER |
If the server supports user authentication, and the script is protected, this is the username they have authenticated as. |
REMOTE_IDENT |
If the HTTP server supports RFC 931 identification, then this variable will be set to the remote user name retrieved from the server. Usage of this variable should be limited to logging only. |
CONTENT_TYPE |
For queries which have attached information, such as HTTP POST and PUT, this is the content type of the data. |
CONTENT_LENGTH |
The length of the said content as given by the client. |
In addition to these, the header lines received from the client, if any, are placed into the environment with the prefix HTTP_ followed by the header name. Any hyphen ("-") characters in the header name are changed to _ characters. The server may exclude any headers which it has already processed, such as Authorization, Content-type, and Content-length. If necessary, the server may choose to exclude any or all of these headers if including them would exceed any system environment limits.
An example of this is the HTTP_ACCEPT variable which was defined in CGI/1.0. Another example is the header User-Agent.
Variable |
Explanation |
HTTP_REFERER |
The referring document (document which linked to or submitted form data to this one). |
HTTP_USER_AGENT |
The browser the client is using to send the request. Format: software/version library/version. |
Server Configuration Functions
Description
Returns the current value (stored in memory by Web+ server) of the specified Web+ configuration key name.Syntax
#webIniGet(webpluskeyname,[AdminPassword])#
Key Name |
Configurable |
Description |
AdminPassword |
No |
Web+ administration password. If no password is specified in the webpsvr.ini file, none is required. |
Remarks
See Also
Example
<webPrint>Description
Put the specified Web+ value into the webpsvr.ini configuration file.Syntax
#webIniPut (SectionName, KeyName, Value, [Password=AdminPassword])#
webpsvr.ini Key Name |
Configurable |
Description |
AdminPassword |
No |
Web+ administration password. Remarks This admin password is optional. If you set the AdminIniPasswordRequired under the [Admin] Section to 0, i.e., it does not require any password to process |
SectionName |
Yes |
The Section Name in the webpsvr.ini. |
Keyname |
Yes |
The Key Name in the webpsvr.ini |
Remarks
See Also
Example
<webPrint></webPrint>
Description
Refreshes the values of Web+ configuration key names.Syntax
<webIniRefresh, [Password=AdminPassword]>Remarks
See Also
Example
<webIniRefresh, [Password="abc"]>
Web+ client-server version adopts cache technique to improve the
performance. User can define the size of the cache Web+ can use to hold wml script
files in memory.
When Web+ server tries to execute a script file, it first checks if it is
in the cache. If it is, then Web+ will access the last update time of this
file, and compare it with the one in cache. If they are equal, Web+ will
simply uses the content in cache to execute. This will save much time of
IO. If the update time of this file is different with the one cached, Web+
will simply dump out the cached file content and load the file into cache
as it is never in cache.
When Web+ loads a file into cache, it will first check if the space left
unused in cache is enough to hold this file. If it can, Web+ simply loads
this file into cache; If not, Web+ will swap the most recent unused script
out of cache till a enough space is found or there is nothing in cache. If
there is nothing in cache but the space is still not enough, Web+ will
simply load the file into a thread private memory to execute without
caching.
Web+ cache is especially useful when your script file is encrypted. Web+
will decrypt it when loading into cache. This is save lot time compared to
loading and decrypting every time.
Description
Returns the ASCII value for the first character in a string.Syntax
#Asc (string)#The string parameter is any valid string expression. If the string contains no characters, a run-time error occurs.
See Also
Appendix A - ANSI Character Set.Example
<webPrint>The ASCII value of "A" is #Asc("A")#.<BR>
The ASCII value of "a" is #Asc("a")#.<BR>
The ASCII value of "ABC" is #Asc("ABC")#.<BR>
</webPrint>
Description
Returns a one character string for the ASCII value.Syntax
#Chr(number)#The number parameter must be a valid numeric expression.
Remarks
Numbers from 0 to 31 are nonprintable ASCII values.See Also
<webPrint>The ASCII character for 65 is #Chr(65)#.<BR>
</webPrint>
Description Testing if a string is of a mask string
.Syntax
#IsMasked(string,mask)#Remarks For a detailed description of mask string's format, pls refer to form
variable's validation.
See Also
Example
#IsMasked("someone@fiu.edu", "a@a.a")#Description
Returns the given String value as an all lowercase String value.Syntax
#LCase(string)#Returns the string value of string after all characters have been converted to lowercase.
Remarks
See Also
UCase FunctionExample
<webPrint>Description
Returns the given String value as an all uppercase String value.Syntax
#UCase(string)#Returns the string value of string after all characters have been converted to uppercase.
Remarks
See Also
LCaseExample
<webPrint>Description
Removes leading spaces (spaces on the left side) of a stringSyntax
#LTrim(string)#Remarks
See Also
RTrim, TrimExample
<webSet #A# = " TalentSoft " >Description
Removes the trailing spaces (spaces on the right side) of a stringSyntax
#RTrim(string)#Remarks
See Also
LTrim, TrimExample
<webSet #A# = " TalentSoft " >Description
Removes the leading and trailing spaces (spaces on both sides) of a stringSyntax
#Trim(string)#Remarks
See Also
RTrim, LTrimExample
<webSet #A# = " TalentSoft " >Description
Returns the number of characters in a String value or the number of bytes needed to store the value in a variable.Syntax
#Len(string)#Returns the number of characters in the string value s.
Remarks
See Also
InStr Function, Mid Function.Example
<webPrint>Description
Returns the leftmost n characters of a string argument.Syntax
#Left(strexpr, n)#
Argument |
Required |
Description |
Strexpr |
Yes |
String expression from which the leftmost characters are returned. This can be any string expression. |
N |
Yes |
Integer expression indicating how many characters to be returned. It must be between 0 and approximately 65,535, inclusive. If n is 0, the return value is a zero-length string. If n is greater than or equal to the number of characters in strexpr, the entire string is returned. |
Remarks
To find the number of characters in strexpr, use Len(strexpr).See Also
InStr Function, Right Function, Mid Function.Example
<webPrint>Description
Returns the rightmost n characters of a string argument.Syntax
#Right(strexpr, n)#
Argument |
Required |
Description |
Strexpr |
Yes |
String expression from which the leftmost characters are returned. This can be any string expression. |
N |
Yes |
Integer expression indicating how many characters to return. It must be between 0 and approximately 65,535, inclusive. If n is 0, the return value is a zero-length string. If n is greater than or equal to the number of characters in strexpr, the entire string is returned. |
Remarks
To find the number of characters in strexpr, use Len(strexpr).See Also
InStr Function, Left Function, Mid Function.Example
<webPrint>Description
Returns the requested number of characters from a given starting position of a String expression.Syntax
#Mid(stringexpr, start [, length])#
Argument |
Required |
Description |
Stringexpr |
Yes |
String expression from which another string is created. This can be any string expression. |
Start |
Yes |
Integer expression that indicates the character position in stringexpr at which the part to be taken begins. |
Length |
No |
Integer expression indicating the number of characters to return. |
Remarks
See Also
InStr Function, Len FunctionExample
<webSet #MyString# = "Web+ is Great">Description
Returns the position of the first occurrence of one string within another string.Syntax
#InStr([start], stringexpr1, stringexpr2, [mode])#
Argument |
Required |
Description |
Start |
No |
Integer expression that sets the starting position for each search; start must be between 1 and approximately 65,535. If start is omitted, the search of strexpr1 begins at the first character position. |
Stringexpr1 |
Yes |
String expression being searched. |
Stringexpr2 |
Yes |
String expression being sought. |
Mode |
No |
If mode is 0, string comparison is case-sensitive; so, for example, "T" doesn't match "t".If mode is 1, string comparison is not case-sensitive; so, for example, "T" matches "t". If mode is omitted, the default mode is 0. |
Remarks
If stringexpr2 is found within stringexpr1, InStr returns the position at which the match was found. If stringexpr2 is zero-length, start is returned. If start is greater than stringexpr1, stringexpr1 is zero-length, or stringexpr2 can't be found, InStr returns 0.See Also
Mid Function.Example
<webPrint>Web+ Output:
The position of the first letter "e" in "TalentSoft Web+" is 4.
Description
Replace the string expression 1 to string expression 2.Syntax
#StrReplace(stringexpr, stringexpr1, stringexpr2, [mode])#
Argument |
Required |
Description |
Stringexpr |
Yes |
String expression being searched. |
Stringexpr1 |
Yes |
String expression being replaced by stringexpr2. |
Stringexpr2 |
Yes |
String expression to replace stringexpr1. |
Mode |
No |
If mode is 0, string comparison is case-sensitive; so, for example, "T" doesn't match "t".If mode is 1, string comparison is not case-sensitive; so, for example, "T" matches "t". If mode is omitted, the default mode is 0. |
Remarks
See Also
Example
<webPrint>Description
Formats a number, date, time, or string according to instructions contained in a format expression.Syntax
#Format(expression, format)#
Argument |
Required |
Description |
expression |
Yes |
Numeric or string expression to be formatted. |
format |
Yes |
Format expression a string of display-format characters that specify how the expression is to be displayed or the name of a commonly used format that has been predefined in Web+. |
To format numbers, you can use the commonly used formats that have been predefined in Web+ or you can create user-defined formats with standard characters that have special meaning when used in a format expression.
The following table shows the predefined numeric format names you can use and the meaning of each:
Format Name |
Meaning |
General Number |
Display the number as is, with no thousand separators. |
Currency |
Display number with thousand separator, if appropriate; display negative numbers enclosed in parentheses; display two digits to the right of the decimal separator and also with the ($) dollar sign. |
Fixed |
Display at least one digit to the left and two digits to the right of the decimal separator. |
Standard |
Display number with thousand separator, if appropriate; display two digits to the right of the decimal separator. |
Percent |
Display number multiplied by 100 with a percent sign (%) appended to the right; display two digits to the right of the decimal separator. |
Scientific |
Use standard scientific notation. |
Yes/No |
Display No if number is 0, otherwise display Yes. |
True/False |
Display False if number is 0, otherwise display True. |
On/Off |
Display Off if number is 0, otherwise display On. |
The following table shows the characters you can use to create user-defined number formats and the meaning of each:
Character |
Meaning |
0 |
Digit placeholder. Display a digit or a zero. If there is a digit in the expression being formatted in the position where the 0 appears in the format string, display it; otherwise, display a zero in that position. If the number being formatted has fewer digits than there are zeros (on either side of the decimal) in the format expression, leading or trailing zeros are displayed. If the number has more digits to the right of the decimal separator than there are zeros to the right of the decimal separator in the format expression, the number is rounded to as many decimal places as there are zeros. If the number has more digits to the left of the decimal separator than there are zeros to the left of the decimal separator in the format expression, the extra digits are displayed without modification. |
? |
Digit placeholder. Display a digit or nothing. If there is a digit in the expression being formatted in the position where the ? appears in the format string, display it; otherwise, display nothing in that position. This symbol works like the 0 digit placeholder, except that leading and trailing zeros aren't displayed if the number has the same or fewer digits than there are ? characters on either side of the decimal separator in the format expression. |
. |
Decimal placeholder. The decimal placeholder determines how many digits are displayed to the left and right of the decimal separator. If the format expression contains only number signs to the left of this symbol, numbers smaller than 1 begin with a decimal separator. If you want a leading zero to always be displayed with fractional numbers, use 0 as the first digit placeholder to the left of the decimal separator instead. |
% |
Percentage placeholder. The expression is multiplied by 100. The percent character (%) is inserted in the position where it appears in the format string. |
, |
Thousands separator. The thousand separator separates thousands from hundreds within a number that has four or more places to the left of the decimal separator. Standard use of the thousand separator is specified if the format contains a comma surrounded by digit placeholders (0 or ?). Two adjacent commas or a comma immediately to the left of the decimal separator (whether or not a decimal is specified) means "scale the number by dividing it by 1000, rounding as needed." You can scale large numbers using this technique. For example, you can use the format string "??0,," to represent 100 million as 100. Numbers smaller than 1 million are displayed as 0. Two adjacent commas in any position other than immediately to the left of the decimal separator are treated simply as specifying the use of a thousand separator. |
Remarks
See Also
DateFormat, TimeFormat, NumberFormat, DecimalFormat, YesNoFormat.Example
<webSet #N1# = 12345.6789>Example Output
Description
Displays a database date/time or date field using the DD/MM/YY format.Syntax
#DateFormat(expression)#
Argument |
Required |
Description |
Expression |
Yes |
String expression to be formatted. |
Remarks
See Also
TimeFormat, FormatExample
<webPrint>Example Output
DateFormat(CurrentDate()) = 24/02/97
Description
Displays a database date/time or time field using the HH:MM AM/PM format. 10:22:41 AMSyntax
#TimeFormat(expression)#
Argument |
Required |
Description |
Expression |
Yes |
String expression to be formatted. |
Remarks
See Also
DateFormat, FormatExample
<webPrint>Description
Gets the year, month, day, minute, second from the date/time stringSyntax
#DatePart(date expression, option)#
Argument |
Required |
Description |
Option |
Yes |
"yyyy" year "y" day of year "m" month "d" day "h" hour "n" minute "s" second |
Remarks
See Also
DateFormat, FormatExample
<webPrint>Description
Displays a numeric expression or a database numeric value as an integer with the thousand-separators. Eg. 1,234,567Syntax
#NumberFormat(expression)#
Argument |
Required |
Description |
Expression |
Yes |
Numeric expression to be formatted. |
Remarks
See Also
FormatExample
<webPrint>NumberFormat(N1) = #NumberFormat(N1)#
</webPrint>
Description
Displays a numeric expression or a database numeric value as an integer with the thousand-separators and two decimal places displayed. E.g. 1,234,567.90Syntax
#DecimalFormat(expression)#
Argument |
Required |
Description |
Expression |
Yes |
Numeric expression to be formatted. |
Remarks
See Also
FormatExample
DecimalFormat(N1) = <webPrint> #DecimalFormat(N1)# </webPrint>Description
Displays a numeric expression or a database numeric value as an integer with the dollar sign ($) in front, thousand-separators, and two decimal places. Negative values are enclosed with parentheses. Eg. $1,234,567.90Syntax
#DollarFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
Numeric expression to be formatted. |
Remarks
See Also
FormatExample
DollarFormat(N1) = <webPrint> #DollarFormat(N1)# </webPrint>Description
Displays boolean data as Yes or No. All non-zero values are displayed as Yes; zero values are displayed as No.Syntax
#YesNoFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
Numeric expression to be formatted. |
Remarks
See Also
Example
YesNoFormat(N1) = <webPrint> #YesNoFormat(N1)# </webPrint>Description
Converts CR/LF sequences into spaces and double CR/LF sequences into HTML paragraph markers (<P>). Useful for displaying data entered into TEXTAREA fields.Syntax
#ParagraphFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression to be formatted. |
Remarks
See Also
StripCR FunctionExample
<webPrint>Description
Strips all carriage returns from the input string expression. Useful for pre-formatted (PRE) display of data entered into TEXTAREA fields.Syntax
#StripCR(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression to be formatted. |
Remarks
This function is equivalent to #StrReplace(stringexpr, Chr(13),"")#See Also
ParagraphFormat FunctionExample
<webPrint>Description
Strips carriage returns and escapes all special characters: greater than (>), less than (<), quote ('), and ampersand (&). Useful for display of HTML code posted using TEXTAREA fields.Syntax
#HTMLCodeFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression to be formatted. |
Remarks
See Also
HTMLEditFormatExample
<webPrint>Description
Behaves identically to HTMLCodeFormat except that it does not add the <PRE> tag to the text that is outputted.Syntax
#HTMLEditFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression to be formatted. |
Remarks
See Also
HTMLCodeFormatExample
<webPrint>Description
Accepts any syntactically valid parameter name and returns the value 1 (True) if the parameter has been passed to the current script or the value 0 (False) if the parameter has not been passed.Syntax
#ParameterExists(formvariable)#
Argument |
Required |
Description |
formvariable |
Yes |
CGI form variable. |
Remarks
See Also
HTMLCodeFormatExample
For example, to test whether a form variable named UserID has been passed to a script you would use the syntax:Description
Preserves single quotes (') in SQL statements. Used for writing SQL statements where you want to prevent Web+ from automatically escaping single-quotes contained in values derived from dynamic parameters.Syntax
#PreserveSingleQuotes(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression. |
Remarks
See Also
Example
For example, to include a dynamic parameter in a SQL statement and suppress the escaping of single quotes you could use syntax like this:Description
URL encodes (replace spaces with a + and non-alphanumeric characters with equivalent hexadecimal escape sequences) the string parameter which is passed to it. This function enables you to pass arbitrary strings (including those with spaces in them) within URLs (Web+ will automatically decode all URL parameters which are passed to a script).Syntax
#URLEncodedFormat(expression)#
Argument |
Required |
Description |
expression |
Yes |
String expression to be formatted. |
Remarks
See Also
Example
<webPrint>
Description
Returns a comma (,) separated list of the values of each of the records from a given database query column. For example, if you ran a query which returned five distinct user-ids, the result of ValueList function would be something like: 12,33,45,51,66.TreatedAsVar() can be used inside a ValueList().
Syntax
#ValueList(querycolumn)#
Argument |
Required |
Description |
querycolumn |
Yes |
Name of the input database query column. |
Remarks
See Also
QuotedValueListExample
<webPrint>Description
Returns a quote enclosed ('xxx') and comma (,) separated list of the values of each of the records from a given database query column. For example, if you ran a query which returned five distinct user-ids, the result of QuotedValueList function would be something like: '12','33','45','51','66'.Syntax
#QuotedValueList(querycolumn)#
Argument |
Required |
Description |
querycolumn |
Yes |
Name of the input database query column. |
Remarks
See Also
ValueListExample
<webPrint>Description
Returns the number of elements in a given string list.Syntax #ListCout(StringList, [Delimiter])#
Argument |
Required |
Description |
StringList |
Yes |
A string consisting of a number of elements separated by a delimiter. |
Delimiter |
No |
The delimiter used to separate elements in the StringList. A comma is used if no delimiter is supplied. |
Remarks
See Also G
etListElementExample
<webSet #StringList# = "abc,def,ghi"><webPrint>
#ListCount(StringList)#
</webPrint>
Web+ Output:
3
Description
Returns the element of a string list corresponding to the supplied index.Syntax #GetListElement(StringList, Index, [Delimiter])#
Argument |
Required |
Description |
StringList |
Yes |
A string consisting of a number of elements separated by a delimiter. |
Index |
Yes |
The index of the element to be returned. |
Delimiter |
No |
The delimiter used to separate elements in the StringList. A comma is used if no delimiter is supplied. |
Remarks
The index begins at 1. If the index is out of range, it returns an empty string.See Also NumberOfListElement
Example
<webSet #StringList# = "abc,def,ghi">webPrint>
#GetListElement(StringList, 2)#
</webPrint>
Web+ Output:
def
Description
Returns a 0 value for an invalid credit card number, or a non-zero value represents different card type.Syntax
#validatecc(ccNumber)#
Argument |
Required |
Description |
ccNumber |
Yes |
The argument can be any numeric expression. |
The following table shows the output and the representation of the card type for the validatecc function:
Output |
Card Type |
0 |
Invalid credit card number |
1 |
American Express |
2 |
Visa |
3 |
Master |
4 |
Discover |
9 |
Unknown card type |
Remarks
See Also
Example
When several operations occur in an expression, each part is evaluated and resolved in a predetermined order. That order is known as operator precedence. Parentheses can be used to override the order of precedence and force some parts of an expression to be evaluated before others. Operations within parentheses are always performed before those outside. Within parentheses, however, normal operator precedence is maintained.
When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last. Within individual categories, operators are evaluated in the order of precedence shown below:
Arithmetic Operators (Listed by precedence)
Precedence |
Operator |
Description |
1 |
- |
Negation |
2 |
^ |
Exponentiation |
3 |
* / |
Multiplication |
3 |
% |
Modulo arithmetic |
4 |
+ |
Addition |
5 |
& |
String concatenation |
*Note When multiplication and division occur together in an expression, each operation is evaluated as it occurs from left to right. Likewise, when addition and subtraction occur together in an expression, each operation is evaluated in order of appearance from left to right.
*Note The string concatenation operator (&) is not really an arithmetic operator, but in precedence it does fall after all arithmetic operators and before all comparison operators.
Comparison Operators (Equal precedence)
Precedence |
Operator |
Description |
5 |
= |
Equality |
5 |
!= |
Inequality |
5 |
Lt |
Less than. Conventional symbol: < |
5 |
Gt |
Greater than. Conventional symbol: > |
5 |
Lte |
Less than or Equal to. Conventional symbol: <= |
5 |
Gte |
Greater than or Equal to. Conventional symbol: >= |
5 |
? |
Contains |
5 |
!? |
Does not contain |
*Note All comparison operators have equal precedence, that is, they are evaluated in the left-to-right order in which they appear.
*Note The Contain (?) and NotContain (!?) operators are not really comparison operators. They are actually a pattern-matching operators. They are equal in precedence to all comparison operators.
*Note Variables that contain numerals function correctly with the "
contains" operator.
Logical Operators (Listed by precedence)
Precedence |
Operator |
Description |
6 |
Not, ! |
Not |
7 |
And, && |
And |
8 |
Or, || |
Or |
Description
Operators are available for numbers n1 and n2 or strings s1 and s2. If any value in an expression is Null then the expression's value is Null. The order of operator evaluation is controlled by operator precedence.Syntax
* / % + - & Lt Lte Gt Gte = Eq != Ne Not And Or ? Contain !? NotContain
Operator |
Description |
n1 * n2 |
Multiply n1 by n2. |
n1 / n2 |
Divide n1 by n2. |
n1 + n2 |
Add n1 to n2. |
n1 - n2 |
Difference of n1 and n2. |
s1 & s2 |
Concatenate s1 with s2. |
n1 Lt n2 |
Return True if n1 is less than n2. Conventional symbol: < |
n1 Lte n2 |
Return True if n1 is less than or equal to n2. Conventional symbol: <= |
Return True if n1 is greater than n2. Conventional symbol: > |
|
n1 Gte n2 |
Return True if n1 is greater than or equal to n2. Conventional symbol: >= |
n1 = n2 |
Return True if n1 is equal to n2. Conventional symbol: = |
n1 Eq n2 |
Return True if n1 is equal to n2. Conventional symbol: = |
n1 != n2 |
Return True if n1 is not equal to n2. Conventional symbol: <> |
n1 Ne n2 |
Return True if n1 is not equal to n2. Conventional symbol: <> |
s1 = s2 |
Return True if s1 is equal to s2. |
s1 Eq s2 |
Return True if s1 is equal to s2. |
s1 != s2 |
Return True if s1 is not equal to s2. |
s1 Ne s2 |
Return True if s1 is not equal to s2. |
Precedence
When several operators are used in an expression, each operator is evaluated in a predetermined order. Operators are evaluated in this order: - (negate)
^ (exponentiation)
* (multiply), / (divide)
+ (add), - (difference)
& (string concatenate)
= (equal), <> (not equal), < (less than) > (greater than), <= (less than or equal to), >= (greater than or equal to), Is (object equivalence)
Not (logical not)
And (logical and)
Or (logical or)
Operators shown on the same line are evaluated from left to right.
Example
<webSet #N1# = 10 >Description
Used to raise a number to the power of an exponent.Syntax
# number ^ exponent #Remarks
The result of ^ computation is a real number.See Also
Operator precedence.Example
<webSet #Power# = #Number ^ Exponent# >Description
Used to multiply two numbers.Syntax
# operand1 * operand2 #See Also
Operator precedence.Example
<webSet #TotalAmount# = #(UnitPrice * Quantity)# >Description
Used to divide two numbers..Syntax
# operand1 / operand2 #See Also
Operator precedence.Example
<webSet #AverageDailyRevenue# = #(AnualRevenue / 365)# >Description
Divides two numbers and returns only the remainder.Syntax
# operand1 % operand2 #Remarks
The modulus, or remainder, operator divides operand1 by operand2 (rounding floating-point numbers to integers) and returns only the remainder as result. For example, in the expression <webSet #A# = #(19.1 % 6.7)# > , A (which is result) equals 5. The operands can be any numeric expression.See Also
Operator precedence.Example
<webSet #A# = #(19.1 % 6.7)# > returns A=5Description
Used to sum two numbers.Syntax
# operand1 + operand2 #See Also
Operator precedence.Example
<webSet #TotalSales# = #(Region1Sales + Region2Sales + Region3Sales)# >Description
Used to subtract two numbers.Syntax
# operand1 - operand2 #See Also
Operator precedence.Example
<webSet #Profit# = #(SalesPrice - Cost)# >
Description
Comparison operators, also known as relational operators, are used to compare two expressions.Syntax
# expr1 operator expr2 #
Operator |
Description |
True if |
False if |
{ = |
Equal to (=) |
expr1 = expr2 |
expr1 != expr2 |
{ != |
Not equal to (<>) |
expr1 != expr2 |
expr1 = expr2 |
{ =$ |
Equal to (=) |
expr1 =$ expr2 |
expr1 !=$ expr2 |
{ !=$ |
Not equal to (<>) |
expr1 !=$ expr2 |
expr1 =$ expr2 |
Lt |
Less than (<) |
expr1 Lt expr2 |
expr1 Gte expr2 |
Gt |
Greater than (>) |
expr1 Gt expr2 |
expr1 Lte expr2 |
Lte |
Less than or Equal to (<=) |
expr1 Lte expr2 |
expr1 Gt expr2 |
Gte |
Greater than or Equal to (>=) |
expr1 Gte expr2 |
expr1 Lt expr2 |
{ ? |
Contains |
||
{ !? |
Does not contain |
See Also
Operator precedence.Example
<webIf #Age Lt 21# >
Description
Used to perform a logical conjunction on two expressions.Syntax
# expr1 { && | And } expr2 #
If expr1 is |
And expr2 is |
The result is |
True |
True |
True |
True |
False |
False |
True |
Null |
Null |
False |
True |
False |
False |
False |
False |
False |
Null |
False |
Null |
True |
Null |
Null |
False |
False |
Null |
Null |
Null |
See Also
Operator precedence.Example
<webIf #Age Gt 21 && Gender = "Male"# >Description
Used to perform a logical disjunction on two expressions.Syntax
# expr1 { || | Or } expr2 #
If expr1 is |
And expr2 is |
The result is |
True |
True |
True |
True |
False |
True |
True |
Null |
True |
False |
True |
True |
False |
False |
False |
False |
Null |
Null |
Null |
True |
True |
Null |
False |
Null |
Null |
Null |
Null |
See Also
Operator precedence.Example
<webIf #(sales Gt 5000) Or (hoursWorked Gt 81)# >Description
Used to perform logical negation on an expression.Syntax
# { ! | Not } expr #
If expr is |
The result is |
True |
False |
False |
True |
Null |
Null |
See Also
Example
#"PC" != "pc"#& String Concatenation Operator
Description
Used to concatenate two strings.Syntax
# operand1 & operand2 #See Also
Operator precedence.Example
<webSet #Name# = #(LastName & FirstName)# >? Like Operator (replaces Contain)
Description
Used to compare two string expressions.Syntax
# expression { ? | Like } pattern #If expression matches pattern, result is 1 (True); if there is no match, result is 0 (False). The case sensitivity and character sort order of the Like operator depend on the setting of the Option Compare statement. Unless otherwise specified, the default string-comparison method for each module is Option Compare Binary; that is, string comparisons are case-sensitive.
Built-in pattern matching provides a versatile tool for string comparisons. The pattern-matching features allow you to use wildcard characters, such as those recognized by the operating system, to match strings. The wildcard characters and what they match are shown in the following table:
See Also
!? NotLikeExample
<webIf #Name ? "jo"# >!? NotLike Operator (replaces NotContain)
Description
Used to compare two string expressions.Syntax
# expression { !? | NotLike } pattern #See Also
? LikeExample
<webIf #Name !? "jo"# >
Description
Causes the currently executing script to terminate immediately.Syntax
<webAbort>Remarks
works within <webPrint> ... </webPrint>.See Also
Example
<webAbort><webIf> <webElseIf> <webElse> Tag
Description
Allows conditional execution, based on the evaluation of an expression. WebIf works inside a <webPrintTable> ... </webPrintTable> container, except for current query variables in the WebIf container.Syntax
<webIf #condition1#>
Part |
Required |
Description |
<webIf> |
Yes |
Keyword that begins the block <webIf>...</webIf> decision control structure. |
Condition1 |
Yes |
One of two types of expressions: A numeric or string expression that evaluates true (nonzero) or false (0 and Null). |
Statementblock-1 |
No |
One or more Web+ statements executed if condition1 is true. |
<ElseIf> |
No |
Keyword indicating that alternative conditions must be evaluated if condition1 is not satisfied. |
Condition2 |
No |
Same as condition1 used in the single-line form shown above. |
Statementblock-2 |
No |
One or more Web+ statements executed if condition2 is true. |
<webElse> |
No |
Keyword used to identify the actions taken if none of the previous conditions are satisfied. |
Statementblock-n |
No |
One or more Web+ statements executed if condition1 and condition2 are both false. |
< /webIf> |
Yes |
Keyword that ends the block form of the <webIf>...</webThen>. |
The
Remarks
webSelectCase webCase may be more useful when evaluating a single expression that has several possible actions.works within <webPrint> ... </webPrint>.
See Also
webSelect webCase webCaseElseExample
<webIf #I Lt 10#><webSelectCase> <webCase> <webCaseElse> Tag
Description
Executes one of several statement blocks depending on the value of an expression.Syntax
<webSelectCase testexpression>
Part |
Required |
Description |
<webSelectCase> |
Yes |
Begins the Select Case decision control structure. Must appear before any other part of the Select Case structure. |
Testexpression |
Yes |
Any numeric or string expression. If testexpression matches the expressionlist associated with a Case clause, the statementblock following that Case clause is executed up to the next Case clause, or for the final one, up to the End Select. Control then passes to the statement following End Select. If testexpression matches more than one Case clause, only the statements following the first match are executed. |
<webCase> |
Yes |
Sets apart a group of Web+ statements to be executed if an expression in expressionlist matches testexpression. |
Expressionlist |
No |
One or more Web+ statements executed if condition1 is true. |
Statementblock-1 |
No |
Elements statementblock-1 to statementblock-n consist of any number of Web+ statements on one or more lines. |
<webCaseElse> |
No |
Keyword indicating the statementblock to be executed if no match is found between the testexpression and an expressionlist in any of the other Case selections. When there is no Case Else statement and no expression listed in the Case clauses matches testexpression, program execution continues at the statement following End Select. |
Statementblock-n |
No |
One or more Web+ statements executed if condition1 and condition2 are both false. |
< /webSelectCase> |
Yes |
Ends the <webSelectCase>. Must appear after all other statements in the <webSelectCase> control structure. |
The
Remarks
Although not required, it is a good idea to have a <webSelectCase> statement in your Select Case block to handle unforeseen testexpression values.works within <webPrint> ... </webPrint>.
See Also
webIf webElseIf webElse.../webIfExample
Example 1: Nested Select...CaseDescription
Repeats a group of instructions a specified number of times.Syntax
<webFor #counter# = #startvalue# To #endvalue# [Step #incrementvalue#]>
Part |
Required |
Description |
<webFor> |
Yes |
Begins a For loop control structure. Must appear before any other part of the structure. |
counter |
Yes |
Numeric variable used as the loop counter. |
Startvalue |
Yes |
Initial value of counter. |
To |
Yes |
Separates startvalue and endvalue. |
Endvalue |
Yes |
Final value of counter. |
Step |
No |
Indicates that increment is explicitly stated. When Step value is positive or 0, loop executes if counter is less than or equal to (<=) endvalue. When Step value is negative, loop executes if counter is greater than or equal to (>=) endvalue. |
Incrementvalue |
No |
Amount counter is changed each time through the loop. If you do not specify Step, incrementvalue is default to 1. |
Statementblock |
No |
Program lines between <webFor> and </webFor> that are executed the specified number of times. |
<webExitFor> |
No |
Only used within a webFor control structure to provide an alternate way to exit. Any number of webExitFor statements may be placed anywhere in the webFor loop. Often used with the evaluation of some condition (for example, webIf), webExitFor transfers control to the statement immediately following the </webFor> tag. |
< /webFor> |
Yes |
Ends a webFor loop. Causes incrementvalue to be added to counter. The </webFor> tag may include an optional counter name for better code readability, such as: </webFor I> |
Remarks
Changing the value of counter while inside a loop can make the program more difficult to read and debug.works within <webPrint> ... </webPrint>.
See Also
webWhile webExitWhileExample
<webSet #startvalue# = 10 >
Description
Repeats statements between the <webWhile value operator value> and </webWhile> statements while a given condition is True.Syntax
<webWhile #value operator value#>Remarks
works within <webPrint> ... </webPrint>.See Also
webFor webExitForExample
<webSet #I#=1>
The value elements in the webIf, webElseIf, webWhile, webSelectCase, and webCase tag can be of three different types:
Value Type |
Explanation |
Examples |
Dynamic parameter |
Form, URL, and CGI parameters as well as fields from query result sets. |
#Form.Name#, #URL.Age# |
Literal numeric values |
Integer values (not delimited by quotes). |
0, 22, 130 |
Literal string values |
Any sequence of characters (delimited by quotes). |
"Mozilla", "User Guide", "Authorized" |
The operator element in the webIf, webElseIf, webWhile, webSelectCase, and webCase tag must be one of the following:
Operator |
Explanation |
= |
Performs a case-insensitive comparison of the two values and returns true if they are identical. |
<> |
Opposite behavior of is. |
? |
Checks to see if the value on the left is contained in the value on the right and returns true if it is. |
!? |
Opposite behavior of contains. |
Gt |
Checks to see if the value on the left is greater than the value on the right and returns true if it is. |
Lt |
Opposite behavior of greater than. |
Gte |
Checks to see if the value on the left is greater than or equal to the value on the right and returns true if it is. |
Lte |
Checks to see if the value on the left is less than or equal to the value on the right and returns true if it is. |
Description
Defines the content-type being returned by the current script.Syntax
<webContent Type="ContentType">Remarks
None.See Also
webLocation, webInclude, webContentExample
<webContent Type="ContentType">Description
Redirects the browser request to another URL. Allow the current browser request to refer another document Instead of outputting the document, you can just tell the browser where to get the new one, or have the server automatically output the new one for you. Defines the path to an HTML file or WML script.Syntax
<webLocation URL="URLAddress">Remarks
works within <webPrint> ... </webPrint>.See Also
webIncludeExample
<webLocation URL="http://www.talentsoft.com/webplus/registration.htm/">Description
Allows the current script to call and include an external script file for current use. The external script file will be processed as if it is a part of the current script file into which it is included.It can be used inside a <webPrint> ... </webPrint> container.
Syntax
<webInclude Script=" scriptFileName">Remarks
works within <webPrint> ... </webPrint>.See Also
webLocationExample
<webInclude Script="/script_library/footer.wml">Description
Call subroutine written by wml tagsSyntax <webCall Script=... Param1=Exp1 [byref|byval] Param2=Exp2
Argument |
Required |
Description |
Script |
Yes |
Logical name of the subroutine file. |
Param1 .. Param2 .. Paramn |
Yes |
Parameter names which can be used in subroutine as #Param.Param1# For example: for XYZ="123", you can use |
[byref|byval] |
Yes |
Define the type of parameter passing. Default is "byval". If a parameter is passed by reference. You can use: <webSet #Param.param1#="OK"> in subroutine to change caller's variable's value. You can also use: <webSet #Caller.anyVar#="ddd"> to alter caller's variable. |
Example
Sub1.wmlHello from Sub1<BR>
<webSet #X#=1233454>
<webSet #Y#=#Param.Name#>
<webPrint>
Caller.X=#Caller.X#<BR>
Local X=#X#<BR>
Parameter Name=#Y#<BR>
Parameter P1=#Param.P1#<BR>
Param.P2[1]=#Param.P2[1]#<BR>
</webPrint>
<webSet #Param.P2[1]# = "Set by Sub">
<webSet #Param.P3#="Error">
<webSet #Param.P4#="123456">
<webSet #Param.P1#="try to alter">
-------------------------------------------------
<webClient Name="test" Persistent=1>
<webSet #X#="abcedfg">
<webSet #Y[]#=",123,456">
<webSet #Client.Status#="OK">
call subroutine<BR>
<webCall script="sub1.wml"
Name="WebPlus Master"
P1=#X#
P2=#Y[]# byref
P3=#Client.Status# byref
P4=#Shared.Count# byref>
out subroutine<BR>
<webPrint>
X=#X#<BR>
Y[1]=#Y[1]#<BR>
Client.Status=#Client.Status#<BR>
Shared.Count=#Shared.Count#<BR>
</webPrint>
Result showed in Browser:
call subroutine
Hello from Sub1
Caller.X=abcedfg
Local X=1233454
Parameter Name=WebPlus Master
Parameter P1=abcedfg
Param.P2[1]=456
out subroutine
X=abcedfg
Y[1]=Set by Sub
Client.Status=Error
Shared.Count=123456
Remarks
Two things have to be done:administrators group.
Note that the subroutine will be executed in a totally different
enviroment from its caller's. This means that they have different Web+
variable enviroment. So the two #X# in the caller's and the subroutine's
will have no interconnection. The same with the Query. The same query
name in these two different enviroments will be different. But the CGI,
CLIENT, SHARED variables are global.
For the subroutine to get the values of the parameters, you need to use
the following syntax:
<webSet #X# = #Param.Param1#>
You can use #Param.Param1# anywhere but you can not modify it.
The subroutine can also alter its caller's variables and this is the way
the subroutine returns values. You need to use the following syntax:
<webSet #Caller.XY#="dasdsada">
Description
Runs an executable program.Syntax
<webRun Exe=#ExecutableCommandLineString# [Type="ExecutableType"] [InPara="InputParameter"] [OutVar=#OutputVariableName#] [TimeOut=NumberSeconds] [Password=WebRunPassword]>
Argument |
Required |
Description |
Exe |
Yes |
Specifies the name of the executable program and its command line arguments. |
Type |
No |
Executable program type. Possible values: |
InPara |
No |
Specifies the input parameters to be passed to passed the executable program. |
OutVar |
No |
Specifies the name of the output variable which will store the result (standard output) of the executable program. |
TimeOut |
No |
Specifies the number of seconds which webRun will wait before finishing and closing the current script file. |
Password |
No |
Specifies the webRun Password in the webpsvr.ini file under the [WebRun] Section. Remarks This webRun password is optional; if you did not type in anything for the webRunPassword under the [webRun] Section, webRun statement does not requires any password to proceed. |
Remarks
See Also
Example
For webRun on Linux, it works fine with commands like "cat":
<webSet #webRunPass# =
"webrunpassword"><webRun Exe=
"cat webpsvr.ini" OutVar=#Var# Password=#webRunPass#><webPrint>
#Var#<BR>
</webPrint>
Using webRun sending fax:
<!--- start of the sample code --->
<webset #webrunpass#="webrunpassword">
<webrun Exe
="/usr/local/sbin/faxmodem modem" password=#webrunpass#><webrun Exe=
"/usr/local/bin/sendfax -n -d 93381900 /webplus/script/webplus/tutor/test.c"Outvar
=#out# password=#webrunpass#><webPrint>out =
#out# <br></webPrint><!--- end of the sample code --->
Here is the output of "webprint" for #out#:
out = request id is 18 (group id 18) for host localhost (1 file)
"password" is required only if that is specified in webpsvr.ini.
Description
Runs the script inside of a file and automatically outputs the result to the browser.Syntax
<webRunFile ScriptFile=#VarName# [RetVar = #retVar#]>Remarks
works within <webPrint> ... </webPrint>.ScriptVar: name of the variable which contains Web+ code.
ScriptFile: Name of the file which contains Web+ code.
RetVar=1 on success.
See Also
<webRunScript >Example
Description
Runs the script inside of a variable and automatically outputs the result to the browser.Syntax
<webRunScript ScriptVar=#VarName# [RetVar = #retVar#]>
Remarks
works within <webPrint> ... </webPrint>.ScriptVar: name of the variable which contains Web+ code.
ScriptFile: Name of the file which contains Web+ code.
RetVar=1 on success.
See Also
<webRunFile >Example
Description
Run an Web+ script using existed DLL file.Syntax
<webDLL FunctionName= LibraryName= Password= RetVar= >
Argument |
Required |
Description |
FunctionName |
Yes |
Specifies the name of the executable function. |
LibraryName |
Yes |
The DLL path and its name. |
RetVar |
Yes |
The value returned. |
Password |
No |
Password in webpsvr.ini's [WebRun] section is give, you have to provide the same password to run webDLL. If there is no such item, you can omit this. |
Remarks
dynamic-link library workspace to do this), such as: test.dll
#include <stdio.h>
#include <windows.h>
#include "webpapi.h"
/* This is the entry point for Web+'s calling
This function must be declared as WEBPLUS_PUBLIC VOID
the function's name can be anything you like,
But the parameter should always be of pattern:
HWEBP *
*/
WEBPLUS_PUBLIC VOID myTest(HWEBP *webpEnv) {
char value[1024];
webpSendHttpText(webpEnv, "<BR>This is a reply from a DLL function<BR>\n");
/* Get the value of a Web+ variable: InParam. You can use this to pass parameters */
webpGetVarValue(webpEnv, "InParam", value);
/* Set a Web+ variable: DllVar's value. You can use this to return a string */
webpSetVarValue(webpEnv, "DllVar", "This value is set by a DLL function");
}
---------------------------------------------------
See Also
Example
<webSet #InParam#="12345"><webDll FunctionName="myTest" LibraryName="c:\test\test.dll" Password=...
RetVar=#ret#>
<webPrint>
<webIf #ret#>
#DllVar#<BR>
<webElse>
Calling dll function failed!<BR>
</webIf>
</webPrint>
Description
Sends SMTP mail to standard and some non-standard mail servers.Syntax
<webMail To="RecepientEmailAddress" [From="SenderEmailAddress"][Reply-To="EmailAddress"] [Cc="CopyToEmailAddresses"][Attach="FileName"] [SendMode="Text|Binary"] [SUBJECT=Subject] [Type="Type"] [Query="QueryName"] [MaxRows="MaximumNumberOfRows"] [Group="SetOfRecords"] [Server="SMTPServerType"] [Port="TCP/IPPortOnSMTPServer"] [TimeOut=NumberOfSeconds]>
Argument |
Required |
Description |
To |
Yes |
The name of the recipient(s) of the e-mail message. This can be either a static address (e.g., TO="support@TalentSoft.com"), a variable containing an address (e.g., TO="#Form.Email#") or the name of a query column which containing address information (e.g., TO="#EMail#"). In the latter case, an individual e-mail message will be sent for every row returned by the query. The TO attribute is required. |
From |
No |
The sender of the e-mail message. This attribute may either be static (e.g. FROM="support@TalentSoft.com") or dynamic (e.g. FROM="#GetUser.EMailAddress#"). The FROM attribute is required. |
Reply-To |
No |
The name of the recipient(s) of the e-mail message. This can be either a static address (e.g., TO="support@TalentSoft.com"), a variable containing an address (e.g., TO="#Form.Email#") or the name of a query column which containing address information (e.g., TO="#EMail#"). In the latter case, an individual e-mail message will be sent for every row returned by the query. Default is the same as From |
Cc |
No |
Additional addresses to copy the e-mail message to (this attribute may also be static or dynamic). The CC attribute is optional. |
Attach |
No |
Attachment for file is also allowed. You can write the Attach argument with variable or string representing the file's logical path. |
SendMode |
No |
Optional attribute defines the attached file mode: either a Text file or a Binary file. If SendMode does not specified, the default mode is Text. |
Type |
No |
Optional attribute specifying extended type attributes for the message. Currently, the only valid value for this attribute is "HTML". Specifying TYPE="HTML" informs the receiving e-mail client that the message has embedded HTML tags that need to be processed. This is only useful when sending messages to mail clients understand HTML (e.g., the Netscape 2.0 e-mail client). |
Query |
No |
The name of the webQUERY from which you want to draw data for message(s) to be sent. This attribute is optional (specify it if you want to send more than one mail message or if you want to send the results of a query within a single message). |
MaxRows |
No |
Optional attribute specifying the maximum number of mail messages you want to send. |
Group |
No |
Optional attribute specifying the query column to use in grouping sets of records together for sending as a single mail message. For example, if you are sending a set of billing statements out to your customers, you might group on Customer_ID. |
Server |
No |
The address of the SMTP server to use for sending messages. |
Port |
No |
The TCP/IP port on which the SMTP server is listening for requests (this is almost always 25) |
TimeOut |
No |
The number of seconds to wait before timing out the connection to the SMTP server. |
Remarks
See Also
Example
FROM="webmaster@TalentSoft.com"
TO="marketing@TalentSoft.com"
ATTACH="/webplus/Talentsoft.dat"
SUBJECT="Web+ Sales Report">
Here is a list of people who have inquired about Web+ Forums over the last 7 days:
<webPrint>
#FirstName# #LastName# (#Company#) - #EMailAddress#
</webPrint>
Regards,
The WebMaster
webmaster@TalentSoft.com
</webMail>
Description
Open a TCP/IP connection to POP3 server.Syntax
<webPopOpen Name= Host=Port= UserName= Password= TimOut= >
Argument |
Required |
Description |
Name |
Yes |
Give the name of this coneection. |
Host |
Yes |
POP3 servers domain name or IP address. |
Port |
No |
The port Number POP3 server running on. Default is 110 |
UserName |
Yes |
User ID with mail account on POP3 server. |
Passerword |
Yes |
Users password. |
TimeOut |
No |
Time limit to wait a reply from POP3 server. Default is 60 seconds. |
Remarks
See Also
Example
Host="mail.talentsoft.com"
User="webplus"
Password="secret">
Description
Retrieve email messages from POP3 connection opened by webPopOpenSyntax
<webPopRetrieve MailBox= MessageNumber=Lines= AttachmentPath= AttachmentPathPassword= MaxRows= StartRow= >
Argument |
Required |
Description |
MailBox |
Yes |
Denote the name of the POP3 connection made by a previous webPOPOpen. |
MessageNumber |
No |
Define those messages list you want to retrieve. For example, "3, 4, 7, 9". Without this attribute, this tag will get all the email messages. |
Lines |
No |
Define how may lines of text you want to retrieve for each message from this message body. Without it, this tag will get every messages whole body text. If it is 0, only get the header of each message. |
AttachmentPath |
No |
Define the logic path for the directory which you want to hold those attached files(texts) for each message. If you do not care about attachment, just do not give out. |
AttachmentPathPassword |
No |
Give the write password for the AttachmentPath. |
MaxRows |
No |
Define the max Number of message you want to get from the POP3 server. It does not function if you defined MessageNumber. |
StartRow |
No |
Get message from the defined by this attribute. It only functions if there is no MessageNumber attribute. Default is 1. |
Remarks
When this tag only gives out a POP3 message retrieve pattern. To get
See Also
Example
MessageNumber="1,3,5"
AttachmentPath="/files"
AttachmentPathPassword="secret">
Description
Delete the messages from POP3 mail server.Syntax
<webPopDelete MailBox= MessageNumber= >
Argument |
Required |
Description |
MailBox |
Yes |
Denote the name of the POP3 connection made by a previous webPOPOpen. |
MessageNumber |
Yes |
Define those messages list you want to retrieve. For example, "3, 4, 7, 9". Without this attribute, this tag will get all the email messages. |
Remarks
The messages will not deleted physically until you close the POPconnection.
See Also
Example
<webPopDelete MailBox="PopQry"MessageNumber="1,3,5">
Description
Undo all the operations made by <webPopDelete >Syntax
<webPopReset MailBox= >
Argument |
Required |
Description |
MailBox |
Yes |
Denote the name of the POP3 connection made by a previous webPOPOpen. |
Remarks
See Also
Example
Description
Close all the POP3 connections made before this tag.Syntax
<webPopClose MailBox= >
Argument |
Required |
Description |
MailBox |
No |
Denote the name of the POP3 connection made by a previous webPOPOpen. Without this parameter, Web+ will close all the connections before this tag. Or closes the connection denoted by MailBox. |
Remarks
If your script does not close a POP3 connection, Web+ will close itautomatically when the script finish.
See Also
Example
Description
Opens a file for input/output (read/write) processing.Syntax
<webFileOpen Name=FileName Mode="{Read|Write|Append}" [Lock="{Shared|Read|Write|Read Write}"] As=FileAliasName Ret=#FileReturnCodeVariableName# [Password=ReadPassword|WritePassword][BinaryMode=0 or 1]>
Argument |
Required |
Description |
Name |
Yes |
A string expression representing the logical path and name of the file to open. A path relative to the current directory can be used. |
Mode |
Yes |
This argument specifies one of the following file open modes. One of the following three values must be specified. |
Lock |
No |
This argument specifies the file locking option in a multiuser or multiprocessing environment to restrict access by other processes or users to an open file. When Open is restricted by a previous process, a Permission denied error occurs. Possible Values: |
As |
Yes |
A string expression representing the alias name of the file being opened. This alias name will be referred to in other webFile operations. |
Ret |
No |
This argument specifies the name of the variable which stores the result of the webFileOpen action. Possible Values of the Variable: |
Password |
No |
This argument specifies the access password for the file open operation. Possible Values of the Variable: If Mode= "Write" or "Append", Password provided must be the FileWritePassword as set in webpsvr.ini. Remarks This password is optional; if you do not specify any password under the [File IO] section in the webpsvr.ini file, then this statement does not require any password to process. |
BinaryMode |
No |
The value is 0 or 1, which means text or binary mode. Default is 0, means open the file in text mode. |
Remarks
You must open a file before any I/O operation can be performed on it. webFileOpen allocates a buffer for I/O to the file and determines the mode of access used with the buffer.
See Also
<webFileClose>Example
<webFileOpen NAME="/test.txt" MODE="WRITE" AS="FileExample" RET=#FileReturnCode# [Password="WritePassword"]><webSet #I# = 0>
<webWhile #FileReturnCode != "EOF"#>
<!--- Set the value for a variable: NewLine --->
<webSet #NewLine# = "Hello webPager! This is my first pager">
<!--- Write a line to the text file --->
<webFilePutLine FILE="FileExample" VALUE=#NewLine# Password="WritePassword">
<webFilePutLine FILE="FileExample" VALUE=#NewLine# Password="WritePassword">
<webSet #NewCharacter# = "A">
<webFilePutChar FILE="FileExample" VALUE=#NewCharacter# Password="WritePassword">
<webSet #I# = #I + 1#>
<webPrint>
Line #I# : #Message1# <BR>
</webPrint>
</webWhile>
<!--- Close the text file --->
<webFileClose FILE="FileExample">
Description
Closes a file opened with the <webFileOpen>.Syntax
<webFileClose File=FileAliasName>Remarks
works within <webPrint> ... </webPrint>.If the
FileAliasName parameter is omitted then all open files for the current script are closed.See Also
<webFileOpen>Example
<webFileClose FILE="FileExample">
Description
Copies a source file to a destination file.Syntax
<webFileCopy From=SourceFileName To=DestinationFileName Ret=#FileReturnCodeVariableName# [FromPassword=ReadPassword] [ToPassword=WritePassword]>
Argument |
Required |
Description |
From |
Yes |
A string expression representing the path and name of the source file to copy from. |
To |
Yes |
A string expression representing the path and name of the destination file to copy to. |
Ret |
Yes |
This argument specifies the name of the variable which stores the result of the webFileCopy action. Possible Values of the Variable: |
FromPassword |
No |
This argument specifies the access password for the file open operation. Password provided must be the FileReadPassword as set in webpsvr.ini. Remarks This password is optional; if you do not specify any password under the [File IO] section in the webpsvr.ini file, then this statement does not require any password to process. |
ToPassword |
No |
Password provided must be the FileWritePassword as set in webpsvr.ini. Remarks This password is optional; if you do not specify any password under the [File IO] section in the webpsvr.ini file, then this statement does not require any password to process. |
Remarks
works within <webPrint> ... </webPrint>.See Also
webFileDelete, webFileRenameExample
<webFileCopy From="SourceFileName" To="DestinationFileName" Ret=#Result# FromPassword=ReadPassword ToPassword=WritePassword>Description
Renames a file.Syntax
<webFileRename From=SourceFileName To=DestinationFileName Ret=#FileReturnCodeVariableName# [FromPassword=ReadPassword] [ToPassword=WritePassword]>
Argument |
Required |
Description |
From |
Yes |
A string expression representing the path and name of the source file to be renamed. |
To |
Yes |
A string expression representing the path and name of the destination file to rename to. |
Ret |
Yes |
This argument specifies the name of the variable which stores the result of the webFileRename action. Possible Values of the Variable: |
FromPassword |
Yes |
Password provided must be the FileReadPassword as set in webpsvr.ini. Remarks This password is optional; if you do not specify any password under the [File IO] section in the webpsvr.ini file, then this statement does not require password to process. |
ToPassword |
Yes |
Password provided must be the FileWritePassword as set in webpsvr.ini. |
Remarks
works within <webPrint> ... </webPrint>.See Also
webFileCopy, webFileDeleteExample
<webFileRename From="SourceFileName" To="DestinationFileName" Ret=#Result# FromPassword=ReadPassword ToPassword=WritePassword>Description
Deletes a file.Syntax
<webFileDelete Name=FileName [Ret=#ReturnCode#] [Password=WritePassword]>Remarks
works within <webPrint> ... </webPrint>.See Also
webFileCopy, webFileRenameExample
<webFileDelete Name="MyFile.txt" Ret=#ReturnCode# Password="abc">Description
Reads the current character from a file opened with the <webFileOpen>.Syntax
<webFileGetChar File=AliasFileName Result=#ResultString# [Password=ReadPassword]>
Argument |
Required |
Description |
File |
Yes |
The alias name of the file being opened, define by the As argument in webFileOpen. |
Result |
Yes |
When meet the end of file, a value "EOF" is stored in the variable defined by the Ret=... of webFileOpen, or a value of "NOEOF" is stored. Possible Values: |
Password |
Yes |
Password provided must be the FileReadPassword as set in webpsvr.ini. Remarks This password is optional. If you did not specify any password in the [File IO] section, webFileGetChar does not require password to prcoess. |
Remarks
works within <webPrint> ... </webPrint>.See Also
webFileGetLineExample
<webFileGetChar File=#SymbolicFileName# Result=#ResultString# Password="abc">Description
Reads the current line from a file opened with the <webFileOpen>.Syntax
<webFileGetLine File=AliasFileName Result=#ResultString# [Password=ReadPassword]>Remarks
works within <webPrint> ... </webPrint>.See Also
webFileGetCharExample
<webFileGetLine File=#SymbolicFileName# Result=#ResultString# Password="abc">Description
Writes a character to a file opened with the <webFileOpen>.Syntax
<webFilePutChar File=AliasFileName Value=#CharacterString# [Password=WritePassword]>
See Also
webFilePutLineExample
<webFilePutChar File=#SymbolicFileName# Value=#ResultString# Password="abc">Description
Writes a line to a file opened with the <webFileOpen>.Syntax
<webFilePutLine File=AliasFileName Value=#CharacterString# [Password=WritePassword]>See Also
webFilePutLineExample
<webFilePutChar File=#SymbolicFileName# Value=#ResultString# Password="abc">Description
Reads the profile parameter value from a text file, usually a *.INI file with key(parameter) names and their values.Syntax
<webGetProfile Section=SectionName Key=KeyName Result=#ResultString# [Size=#BufferSize#] File=#FileName# [Password=ReadPassword]>
Argument |
Required |
Description |
Section |
Yes |
Profile section name, indicated by square brackets in the INI file. eg. [Main] |
Key |
Yes |
Profile key name, or parameter name. |
Result |
Yes |
Result, or value, of the profile key parameter. |
Size |
No |
Buffer size. If Size is not specified, the default value is 1024 byte. If Result is longer than Size, anything that exceeds Size limit will be truncated. |
File |
Yes |
File name of the INI file. |
Password |
Yes |
Password provided must be the FileReadPassword as set in webpsvr.ini. Remarks This password is optional. If you did not specify any password in the [File IO] section, webGetprofile does not require password to prcoess. |
See Also
Remarks
webGetProfile command can now hold up to 8 KB of dataExample <webGetProfile file="test.ini" section="main" key="test"
value=#var#>
<webPrint>#var#</webPrint>
Description
Writes the profile key (parameter) value to a text file, usually a *.INI file with key(parameter) names and their values.Syntax
<webPutProfile Section=SectionName Key=KeyName Value=#ValueString# File=#FileName# [Password=WritePassword]>
Argument |
Required |
Description |
Section |
Yes |
Profile section name, indicated by square brackets in the INI file. eg. [Main] |
Key |
Yes |
Profile key name, or parameter name. |
Value |
Yes |
Value, of the profile key parameter to be written (put) to the file. |
Size |
No |
Buffer size. If Size is not specified, the default value is 1024 byte. If Result is longer than Size, anything that exceeds Size limit will be truncated. |
File |
Yes |
File name of the INI file. |
Password |
Yes |
Password provided must be the FileWritePassword as set in webpsvr.ini. Remarks This password is optional. If you did not specify any password in the [File IO] section, webFilePutProfile does not require any password to prcoess. |
See Also
webGetProfileExample
<webPutProfile Section=#SectionName# Key=#KeyName# Result=#ResultString# Size=#BufferSize# File=#FileName# Password="abc">Description
Prints out the file as a text file. WebInclude can be used inside a <webPrint> ... </webPrint> container.Syntax
<webPrint [Query=QueryName] [File=FileName] [MaxRows=MaximumNumberOfRows] [Group=GroupByName] [Password=ReadPassword] [HTMLFormat=On|Off] [PreFormat=On|Off]>
Argument |
Required |
Description |
File |
Yes |
The logical path of the file defined in the webpsvr.ini. |
Password |
No |
Password provided must be the FileWritePassword as set in webpsvr.ini. Remarks This password is optional. If you did not specify any password in the [File IO] section, webFilePutProfile does not require any password to prcoess. |
HTMLFormat |
No |
This option allows you to output the file in the browser. By default, it is On. |
PreFormat |
No |
This option allows you to output the file "as it is" to the browser. |
Example
<webPrint File="/webplus/webPrintExample.wml" Password="abc"> </webPrint>Description
Give out a unused file name under the directory defined by enviromentvariable TEMP. It is a physical file name.
Syntax
#DefaultFileName()#Remark
Web+ has other function to give out unused file name in logical path.Example
<webSet #FN#=#DefaultFileName()#>
Database Processing Statements
Description
Get the current record number when doing a query.Syntax #CurrentRow()#
Remarks If you use #CurrentRow()# out of a query, it returns 0.
See Also
Example
<webPrint Query="Test" >#CurrentRow()#
</webPrint>
Description
Inserts a new record into a database.Syntax
<webDbInsert DataSource=ODBCDataSourceName TableName=DatabaseTableName [TableOwner=TableOwnerName] [TableQualifier=TableQualifier] [FormFields=Formfields] >
Argument |
Required |
Description |
DataSource |
Yes |
Name of the ODBC data source containing your table. |
TableName |
Yes |
Name of the table you want the form fields inserted to. |
TableOwner |
No |
For data sources that support table ownership (e.g., SQL Server, Oracle, & Watcom SQL), you may use this field to specify the owner of the table. |
TableQualifier |
No |
For data sources that support table qualifiers, you may use this field to specify the qualifier for the table. The purpose of table qualifiers varies across drivers (e.g., for SQL Server and Oracle the qualifier refers to the name of the database containing the table; for the Intersolv dBase driver the qualifier refers to the directory where the DBF files are located). |
FormFields |
No |
A comma separated list of form fields to insert or update (if this attribute is not specified then all fields in the form are included in the operation). |
Remarks
See Also
webDbUpdateExample
<webDbInsert DataSource="Registration DB" TableName="User"><HTML>
<Body>
<!--- Set the value for a variable: NewLine --->
You have been registered for TalentSoft Internet Seminar.
</Body>
</HTML>
Description
Updates an existing record in a database.Syntax
<webDbUpdate DataSource=ODBCDataSourceName TableName=DatabaseTableName [TableOwner=TableOwnerName] [TableQualifier=TableQualifier] [FormFields=Formfields] [Key="SSN"] >
Argument |
Required |
Description |
DataSource |
Yes |
Name of the ODBC data source containing your table. |
TableName |
Yes |
Name of the table you want the form fields inserted to. |
TableOwner |
No |
For data sources that support table ownership (e.g., SQL Server, Oracle, & Watcom SQL), you may use this field to specify the owner of the table. |
TableQualifier |
No |
For data sources that support table qualifiers, you may use this field to specify the qualifier for the table. The purpose of table qualifiers varies across drivers (e.g., for SQL Server and Oracle the qualifier refers to the name of the database containing the table; for the Intersolv dBase driver the qualifier refers to the directory where the DBF files are located). |
FormFields |
No |
A comma separated list of form fields to insert or update (if this attribute is not specified then all fields in the form are included in the operation). |
Key |
No |
Where keystring can be "SSN", "FirstName,LastName",... This feature is useful to help Web+ form the where condition part of the SQL statement. So if you have <webUpdate ... Key="SSN" ...> The corresponding sql statement will be something like: update .... where SSN=... If you provide it, this key(s) will be added to the table's key list to form the whole key list. |
Remarks
See Also
webDbInsertExample
<webDbUpdate DataSource="Registration DB" TableName="User" FormFields="PhoneNo"><HTML>
<Body>
<!--- Set the value for a variable: NewLine --->
Your registration for TalentSoft Internet Seminar has updated.
</Body>
</HTML>
Description
Submit a query using an SQL statement to a database.Syntax
<webDbQuery Name="Query Name" DataSource="ODBC DataSource Name" SQL="SQL Statement" [MaxRows=MaximumNumberOfRows] [StartRow=Number] [TimeOut=Milliseconds] [Debug] >
Argument |
Required |
Description |
Name |
Yes |
A name you assign to the query. Query names must begin with a letter and may consist of letters, numbers, and the underscore character (spaces are allowed if the query name is inside the double- quotes ( "")). The query name is used later in the script to reference the queries result set. |
DataSource |
Yes |
The name of the ODBC Data Source from which this query should retrieve data. |
SQL |
Yes |
An SQL statement to be processed by the database. |
StartRow |
No |
Attempt to use ODBCs cursor feature if available. |
MaxRows |
No |
The maximum number of records (rows) to be returned in the result set. |
TimeOut |
No |
The maximum time in milliseconds for the query to execute before returning an error indicating that the query has timed-out. Note that this attribute is not supported by most ODBC drivers (it is, however, supported by the SQL Server 6.0 driver). |
Debug |
No |
Turns on debug mode for debugging queries. Specifying this argument causes the SQL statement actually submitted to the data source and the number of records returned from the query to be output. |
Remarks
If the SQL argument of the webDbQuery becomes too complex, or too long to fit on a single line, you may split it across multiple lines. In general, it is considered a good programming style to format your SQL statements structurally into several lines, because it makes your code much more readable. (Please refer to the following example)
You can execute a stored procedure from Web+. To do this, use the
execute statement as in the second example below.See Also
webDbQueryMoreExample
<webDbQuery Name="Employee List" DataSource="Employee DB"
<!--- Stored Procedure Example --->
<webDbQuery Name="Testing" Datasource="Image"
SQL="execute get_i_names" Debug>
<webPrint Query="Testing">
:
</webPrint>
Description
An optional sub-tag of webDbQuery, which specifies additional SQL clauses to be appended to the main SQL statement.Syntax
<webDbQuery Name="Query Name" DataSource="ODBC DataSource Name" SQL="SQL Statement" [MaxRows=MaximumNumberOfRows] [TimeOut=Milliseconds] [Debug] >
Argument |
Required |
Description |
SQL |
Yes |
Additional SQL clauses to be appended to the main SQL statement. |
Remarks
See Also
webDbQueryExample
<webDbQuery Name="SiteSearch" DataSource="Sites Database" SQL=" SELECT * FROM SITES WHERE SiteType = #SiteType# " >
<webIf #Form.City != ""#>
<webDbQueryMore SQL=" AND City = '#Form.City#' ">
</webIf >
<webIf #Form.SortOrder != ""#>
<webDbQueryMore SQL=" ORDER BY #Form.SortOrder# ">
</webIf >
</webDbQuery>
Description
Get the relavent database information about a particular datasource.Syntax
webDataSource(DataSource-Name[,Option] )
Argument |
Required |
Description |
DataSource-Name |
Yes |
DataSource-Name is the name of a particular datasource. |
Option |
No |
Options can be: "DataSourceType", "DataBase", "Host", "Port", and "Connect" Without Option, the Connect is default. |
Remarks
others. Pls note for Unix platform, all database connection is made on the
fly, this function will always return 0 except within a
<webPrint Query ..>
Example
<webSet #DBVer#=#WebDataSource("Webplus_Examples","DataSourceTe")#><webPrint> Database Version is: #DBVer# </webPrint>
Description
Provides database transaction processing. All queries contained within a webDbTransaction tag are treated as a transactional unit. This means that changes made to the database are not permanently committed until all queries in the transaction block have executed successfully. If an error occurs in one of the queries, all changes made by previous queries within the transaction block are rolled back. An optional sub-tag of webDbQuery.Syntax
<webDbTransaction [Isolation="IsolationSetting"]>
Argument |
Required |
Description |
Isolation |
No |
The ISOLATION attribute provides advanced control over how the database engine does locking during the transaction. Setting ISOLATION levels is an advanced technique which is supported by very few ODBC drivers. Consult your drivers documentation for more detailed information on the isolation levels it supports and on the behavior of the driver for each level. The valid values for the ISOLATION attribute are:
|
Remarks
Not every driver supports transactions (e.g., the SQL Server and Access drivers do while the FoxPro, dBase, and Paradox drivers do not), and not every driver that supports transactions supports all ISOLATION levels (e.g., the Access driver supports only READ_COMMITTED). When you attempt to use a transaction/isolation-level combination for a specific driver, Web+ queries the driver for its transaction capabilities and returns an error if the driver indicates that it is not capable of implementing the request.See Also
webDbQuery, webDbRollBackExample
<webDbTransaction>
Description
Undo all the changes made from <webDbTransaction>.Syntax
<webDbRollBack>Remarks
See Also
webDbQueryMore, webDbTransactionExample
<webDbTransaction>
<!--- Undo all the changes from the above <webDbTransaction> --->
<webDbRollBack>
Description
Prints information based on the records returned by a query.Syntax
<webPrint [Query=QueryName] [File=FileName] [MaxRows=MaximumNumberOfRows] [Group=GroupByName] >
Argument |
Required |
Description |
Query |
Yes |
The name of the query as specified in < webDbQuery> from which you want to draw data for the output section. |
MaxRows |
No |
The maximum number of record rows to be displayed in the output section. |
Group |
No |
The name(s) of the database column(s) with which output will be grouped by. |
Remarks
See Also
webDbQueryMoreExample
<webDbQuery Name="EmployeeList" DataSource="Employee DB"<webIf #EmployeeList.RecordCount = 0#>
There is no employees in this department.
<webElse>
<webPrint Query="EmployeeList" Group="DepartmentID" >
<P> <H4>#EmployeeList.State#</H4>
<UL>
<webPrint>
<LI> #StateID# #StateName#
</webPrint>
</UL>
</webPrint>
</webIf>
Description
Printing query results in tabular format. WebIf works inside a <webPrintTable> ... </webPrintTable> container.Syntax
<webPrintTable [Query=QueryName] [File=FileName Delimiter=DelimiterString ] [MaxRows=MaximumNumberOfRows] [ColSpacing=n] [ColSpacing=n] [ColHeaders] [HeaderLines=n] [HTMLTable [WidthStyle={"percent"|"pixel"}]] >
Argument |
Required |
Description |
Query |
Yes |
The name of the query as specified in < webDbQuery> from which you want to draw data for the output section. |
MaxRows |
No |
The maximum number of record rows to be displayed in the output section. |
ColSpacing |
No |
The number of spaces between columns. |
ColHeaders |
No |
Specifies whether column headers are displayed above each column. If this tag is present, column headers are printed above each column. The contents of the headers are controlled by the Header argument of the webPrintTableCol tag. |
HeaderLines |
No |
Specifies the number of lines to use for the table header. Default Value = 2 (this leaves one line between the headers and the first row of the table.) |
HTMLTable |
No |
Displays the table as an HTML 3.0 table format |
WidthStyle |
No |
Specifies the HTML table Width style, either as percent or as fixed pixel. Possible values: |
Remarks
See Also
webDbQuery, webPrintTableColExample
<webDbQuery Name="Customer DB" DataSource="Customers"Description
Prints information from a query in tabular format.Syntax
<webPrintTable [Query=QueryName] [File=FileName Delimiter=DelimiterString] [MaxRows=MaximumNumberOfRows] [ColSpacing=n] [ColSpacing=n] [ColHeaders] [HeaderLines=n] [HTMLTable]>
Argument |
Required |
Description |
Header |
Yes |
The text to use for the column's header. |
Width |
No |
The width of the column in characters. If the length of the data to be displayed is longer than this, it will be truncated to fit. |
Align |
No |
Specifies column alignment. Possible values: Left, Right, or Center Default Value=Left |
Text |
No |
Specifies the display format for the output column text according to the HTML tags and dynamic parameters contained in the Text attribute. Double-quote (") is used to delimit text which determines what will be displayed in the column. It can consist of a combination of literal text, HTML tags, and query result set field references. This means you can embed hyperlinks, image references, and even input widgets within table columns. Since double-quotes (") and pound signs (#) are used as the delimiters for the Text attribute and as the field delimiter within the Text attribute, respectively, both require special syntax for inclusion in the Text attribute. To specify a single double-quote, use two double-quotes (""). To specify a single pound sign, use two pound signs (##). |
Bgcolor |
No |
The Hex Decimal for the color s. Remarks Since pound signs (#) are used as the field delimiter for the Text attribute. In order to specify a single pound sign, use two pound signs (##) for the background color. |
Remarks
See Also
webDbQuery, webPrintTableExample
<webPrintTable Query="Customer DB" HTMLTable border><webPrintTableCol Header="First Name" Width=25 Align=Left Text=#FirstName#>
<webPrintTableCol Header="Last Name" Width=25 Align=Left Text=#LastName#>
<webPrintTableCol Header="Work Phone" Width=20 Align=Center Text=#WorkPhone# Bgcolor="##FF0000">
</webPrintTable>
Description
Stores a cookie onto the browser.Syntax
<webCookie Name
=CookieVariableName Value=CookieValue Expires=Expiration [Secure=securityoption] [Path="/"]>
Argument |
Required |
Description |
Name |
Yes |
The name of the cookie variable. |
Value |
Yes |
The value to be assigned to the cookie variable. |
Expires |
Yes |
The expiration of the cookie variable. Can be specified as a date (e.g. 12/31/96), number of days (e.g. 10, 100), NOW or NEVER. Using NOW effectively deletes the cookie from the clients browser. |
Secure |
No |
Specifies the security requirement for transmitting the cookie variable. If the browser does not support SSL security then the cookie will not be sent. |
Path |
No |
By default Path="/" |
Remarks Web+ follows the strict format of COOKIE setting, not default way. I
also made the client identifier UCID to be set at the root level (with
path=/ in setting cookie) so it will be valid for every subpath.
See Also
Example
This example stores the users ID number 12345 as a variable (UserID) in his or her browser. The cookie variable will expire in 100 days.<webCookie Name
="UserID" Value="12345" Expires="100" Path="cgi-bin">
TCP/IP Communication Statements/Functions
Description
Get the current number of connection made by all Web+ clients.Syntax
#webGetConnection()#See Also
Example
#webGetConnection()#
Description
Opens a socket for TCP/IP communication with another host.Syntax
<webSocketOpen Host=DomainName|IPAddress Port=PortNumber Name=SocketName Result=#ReturnValue# [TimeOut=#n#]>
Argument |
Required |
Description |
DomainName IPAddress |
Yes |
The domain name or standard 32-bit IP address of the host to which you want to connect. |
Port |
Yes |
The protocol port of the remote machine. |
Name |
Yes |
The name given to this socket. |
Result |
Yes |
A variable which will be set to 1 if the socket is successfully opened or 0 if it is not. |
TimeOut |
No |
The maximum time Web+ will wait for the connection to be made before returning an error message. By default, it will use the time under the SocketTimeOut keyname in the file WEBPSVR.INI.. |
Remarks
A socket is the interface by which a program communicates with another host machine. Before your Web+ scripts can communicate with another computer, you must open a socket to that computer. Then you may communicate with it by sending and receiving text.
A socket handle is an ID number used to identify a socket. Whenever you want to send or receive text using a socket, or close a socket, you must supply the handle for the socket you want to use.
Protocol Ports are numbers associated with various protocols used for transferring information from one host to another. By supplying a port number you can tell the remote machine what protocol you intend to use. The way a remote machine responds to your communication depends on what communication protocol you use.
Here are some commonly used protocol port numbers:
Protocol Port #
Echo Protocol 7
File Transfer Protocol (FTP) 21
Telnet Protocol 23
Simple Mail Transfer Protocol (SMTP) 25
Finger Protocol 79
Hypertext Transfer Protocol (HTTP) 80
See Also
<webSocketClose>, <webSocketSend>, <webSocketReceive>Example
<!--- First, use webSocketOpen to open a socket to search.yahoo.com using the HTTP port (80). Second, use webSocketSendText to send a message to request a search on the string "TalentSoft". Then, use webSocketRcvText to receive search result from yahoo and store the result in the Text variable. Afterwards, close socket using webSocketClose. Last, display the search result stored in the Text variable. ----><webSocketOpen
Host="search.yahoo.com" Port=80 Name=Sock Result=#Ret#><!--- If the connection was successful, ... --->
<webIf #Ret#>
<!---- Send some text to yahoo ---->
<webSocketSend Socket=Sock Text=#"GET /bin/search?p=talentsoft" & Chr(13) & Chr(10)# Result=#Ret#>
<!---- If the text was sent successfully, ... ---->
<webIf #Ret#>
<!---- Receive some text from yahoo and print it out ---->
<webSet #Tag# = 1>
<webWhile #Tag#>
<webSocketReceive Socket=Sock Text=#Text#>
<webPrint> <p>#Text# </webPrint>
<webIf #InStr(Text, "</HTML>")#>
<webSet #Tag# = 0>
</webIf>
</webWhile>
</webIf>
<!---- Close the socket ---->
<webSocketClose Socket=Sock>
</webIf>
Description
Closes a socket opened with <webSocketOpen>.Syntax
<webSocketClose Socket=Handle Result=#ReturnValue#>
Argument |
Required |
Description |
Socket |
Yes |
The socket handle which was set by the <webSocketOpen> statement. |
Result |
No |
A variable which will be set to 1 if the socket is successfully closed or 0 if it is not. |
Remarks
works within <webPrint> ... </webPrint>.See Also
<webSocketOpen>, <webSocketSend>, <webSocketReceive>Example
<webSocketClose Socket=Sock>
Description
Sends data through a socket opened with <webSocketOpen>.Syntax
<webSocketSend Socket=Handle Text=#Text# Result=#ReturnValue#>
Argument |
Required |
Description |
Text |
Yes |
The text to be sent to the remote machine. |
Socket |
Yes |
The socket handle which was set by the <webSocketOpen> statement. |
Result |
No |
A variable which will be set to 1 if the text is successfully sent or 0 if it is not. |
Remarks
The amount of text which can be sent at one time is limited to about 8K. To send more, you can use multiple <webSocketSend> statements..
See Also
<webSocketOpen>, <webSocketClose>, <webSocketReceive>Example
<webSocketSendText Socket=Sock Text=#"GET /index.htm" & Chr(13) & Chr(10)# Result=#Ret#>Description
Receives data through a socket opened with <webSocketOpen>.Syntax
<webSocketReceive Socket=Handle Text=#Buffer# Result=#ReturnValue# [NumofChars=#Num#] [NullTo=""]>
Argument |
Required |
Description |
Text |
Yes |
A variable in which the received text will be stored. |
Handle |
Yes |
The socket handle which was returned by the <webSocketOpen> statement. |
RetVar |
No |
A variable which will be set to 1 if the text is successfully received or 0 if it is not. |
NumOfChars |
No |
It only works for the new syntax of Web+'s socket operation. When there are not such amount of data, Web+ will return the obtainable number of chars and set the Result var's value to -1 if a timeout occurs. NumOfChars is used to designate how many characters you want to receive for a socket read. If it is 10, means you want to read 10 characters |
NullTo |
No |
If you have a NullTo=" ", Web+ will change all the NULLs in the string to spaces. NullTo is used to change the NULL character(s) (in C, ascii value 0) to some user defined character or string. This is because when you use socket to communicate with other systems, they may send back string with NULL in |
Remarks
The amount of text which can be received at one time is limited to about 8K. To send more, you can use multiple <webSocketRcvText> statements.
See Also
<webSocketOpen>, <webSocketClose>, <webSocketSend>Example
<webSocketReceive Socket=Sock Text=#Text#>
How to use wmlencode.exe?
The purpose of the file is to encrypt source code from users for the commercial reason.
The code developer could run wmlencode.exe under DOS prompt to encrypt the source code.
The general syntax is:
wmlencode [-r] source [destination]
-r means recursively encrypt files under the subdirectory.
source can be: xyz.wml, *.wml, dir/*.wml
destination can be: uvw.wml, *.xyz, directory
If the source and destination directory is different, Web+ will encode the
files in source and write them to destination with the same file names. If
they are the same directory, Web+ will use "ewm" as the extension.
REMARK: Web+ will decrypt the script when execute the encrypt script. The encrypt script must have a extension .wml. If after encryption, the file have an extension other than .wml. It has to be renamed for the Web+ to run.
Description
Encodes a string. Typically used to encode credit card numbers.Syntax
#EncodeCC(encodedstring)#Remarks
The amount of text which can be received at one time is limited to about 8K. To send more, you can use multiple <webSocketRcvText> statements.See Also
EncodeCCExample
#DecodeCC(Encode("123123213"))#Description
Decodes the encoded string done by EncodeCC.Syntax
#DecodeCC(encodedstring)#Remarks
The amount of text which can be received at one time is limited to about 8K. To send more, you can use multiple <webSocketRcvText> statements.See Also
EncodeCCExample
#DecodeCC(Encode("123123213"))#
Custom Tags and COM/DCOM Objects
Building custom tags in Web+.
All custom tags work within
<webPrint> ... </webPrint>.<web_ChkMail Tag (Custom Tag Example)>
Description
This tag will contact the mail server (IMAP server) to get the totalemails and new emails in a particular user's inbox.
Syntax
<web_ChkMail Name=... IMAPHost=... Port=... UserID=...Password=...>
Example
<web_ChkMail Name="test" IMAPHost="mail.talentsoft.com"UserID="WebPlus"
Password=secret>
<webPrint>
<webIf #test.result#>
Total Emails=#test.TotalEmails#<BR>
New Emails=#test.NewEmails#<BR>
<webElse>
Error in Checking Emails<BR>
#Error.ErrorMsg#<BR>
</webIf>
</webPrint>
Remarks
Here Port is optional.The default port is 143. Parameter Name here functions just like the
Name parameter in <webDbQuery Name=...>. For <web_ChkMail
...>, the result has three columns. They are: Result, TotalEmails,
NewEmails. Like the example above.
In order to run the above sample, you need to add the following into
webpsvr.ini's [Custom Tag] section. Using Web+ Server Manager to do
this is better.
-----------------------------------------------
TagName1=ChkMail
DllPath1=c:\ztemp\chkmail.dll
FuncName1=chkMail
-----------------------------------------------
Note: web_ChkMail adopts IMAP4 protocal instead of POP3
protocal, and in fact IMAP4 is much better than POP3 in performance
and functionality. So we can do a <webIMAP ...> instead of
<webPOP ..> if needed (PINE use IMAP, not POP, and so it is fast
to get the total email list).
<web_QueryIpHostName > Tag (Custom Tag Example)>
Description
This tag will give the domain name for the IP address in #Var#.Syntax
<web_QueryIpHostName IP=#IP# Name=#Var# Byref>Example
<webSet #IP#="208.138.189.148"><web_QueryIpHostName IP=#IP# Name=#HostName# Byref>
<webPrint>
IP=#IP#<br>
HostName=#HostName#
</webPrint>
Remarks
In order to run the above sample, you need to add the following intowebpsvr.ini's [Custom Tag] section. Using Web+ Server Manager is
better.
-----------------------------------------------
TagName2=ChkMail
DllPath2=c:\ztemp\chkmail.dll
FuncName3=chkMail
-----------------------------------------------
<web_Print> Tag (Custom Tag Example)
Description This custom tag will print text or file on the Web+ server machines printer.
Syntax <web_Print Printer=... Text=... DocName=... Status=...>
Example
<web_Print Printer="\\jungle\np252" File="c:\ztemp\test.dat"DocName="test" Status=#Ret# byref>
<webIf #Ret#>
Finish printing<br>
<webelse>
#Error.ErrorMsg#<br>
</webIf>
</webPrint>
Remarks
In order to run the above sample, you need to add the following intowebpsvr.ini's [Custom Tag] section. Using Web+ Server Manager is
better.
-----------------------------------------------
TagName3=Print
DllPath3=c:\ztemp\webprint.dll
FuncName3=webprint
-----------------------------------------------
<web_Pager> Tag (Custom Tag Example, Unix and Linux Only)
Description This tag works like a Pager.
Syntax <web_Print Printer=... Text=... DocName=... Status=...>
Example
<web_Pager Number="918007243624,,,,,1926958,,,,1##,,8688042##"SerialPort="/dev/modem"
Error=#ret# byref>
<webPrint>
<webIf #ret#>
#Error.ErrorMsg#<BR>
<webElse>
Page Successful!<BR>
</webIf>
</webPrint>
Remarks
In order to run the above sample, you need to1. Add the following into
webpsvr.ini's [Custom Tag] section. Using Web+ Server Manager is
better.
------------------------------------
TagName : Pager
DllPath : /a/grads.cs.fiu.edu./disk/41/WebPlus/oracle/webpsvr/pager.so
FuncName : paging
2. Also copy pager.so in webplus/bin
<webObject> Tag (ActiveX/OLE Automation Interface)
Description
Calling ActiveX(OLE) automation interface.Syntax
<webObject ProgID= AS= Local= ServerType= >
Argument |
Required |
Description |
ProgID |
Yes |
The OLE(COM) objects ProgID. |
As |
Yes |
The name Web+ will be used to communicate with that object. |
Local |
No |
Reflects the local conventions and language for a particular geographical region. Default is English. |
ServerType |
Yes |
Define the type of the OLE(COM) object. Can be Server type: "InProc " , "Local" , "Remote" |
Remarks
Web+ NT Service version works for this sample both on System AccountOr normal user account.
Web+ extended the syntax of <webObject ...> a little to include
another attribute:
ServerType=...
It can be value of "INPROC", "LOCAL" and "REMOTE".
Example
<webObject ProgID="Excel.Application" As="test">
Another Example:
<webObject ProgID="Crystal.CrystalReport" As="report">
<!--- Crystal Report must be installed in order to try this script --->
<webSet #report.ReportFileName#="d:\webplus\script\user1\Testwebplus40\activity.rpt"> <!--- here is physical path --->
<webSet #report.PrintFileType#=20>
<webSet #report.Destination#=2>
<webSet #report.PrintFileName#="d:\web\webp40\ole11.htm">
<!--- here is physical path --->
<webSet #x#=#report.PrintReport()#>
<webIf #!x#>
<webLocation URL="http://www.talentsoft.com/Webp40/ole11.htm">
<!--- Webp40 is a directory under www root, this .htm file could be any name--->
<webElse>
Failed<BR>
</webIf>
Description
Return the value of VarName + 1.Syntax
#IncrementValue(VarName)#Remarks
This function is designed purely for backward compatibility.See Also DecrementValue()
Example
<webSet #X# = #IncrementValue(X)#>Description
Return the value of VarName - 1.Syntax
#DecrementValue(VarName)#Remarks
This function is designed purely for backward compatibility.See Also IncrementValue()
Example
<webSet #X# = #IncrementValue(X)#>
Description
Sounds the bell of the Web+ server.Syntax
<webBeep>Remarks
The beep sound your Web+ server makes is a function of your hardware.Example
<webBeep> <webBeep> <webBeep> <webBeep> <webBeep>Description
Delete a particular client variable within the session defined by webClients Name parameter.Syntax
#ClientDeleteVar(VarNameString)#Remarks
Example
#ClientDeleteVar("Password")#Description
List all the variables in a comma seperated way with the session defined by webClients Name parameter.Syntax
#ClientVarList()#Remarks
Example
#ClientVarList()#Description
Delete all the client variables within the session defined by webClients Name parameter.Syntax
#ClientDeleteAllVars()#Remarks
Example
#ClientDeleteAllVars()#Description
Check for the variable exists at the prompt.Syntax
<webVarExistCheck On>, <webVarExistCheck Off>Remarks
If you refer a variable in any expression other than ParameterExists and the variable has not been assigned any value, webplus will prompt that this variable is not defined. So it is better to check those variables especially from the form by using ParameterExists first and then use it.See Also
ParameterExists functionExample
<webVarExistCheck Off>Description
Makes the web browser pop up an authenticate window, which requests a username and password.Syntax
<webAuthenticate>Remarks
If you add a dollar sign ("$") to the beginning of the CGI program (in this case, "$webplus.exe") the browser will send the password to the Web+ server. Otherwise it will only send the user name.Example
<webIf #CGI.Auth_User == ""#><webAuthenticate>
<webElse>
<webPrint>#CGI.Auth_User#</webPrint>
</webIf>
Description
Checks the syntax of a script file. If errors are found, then the RetVar is set to 0 and the file specified by RetFile is created, documenting the errors. If no errors are found, RetVar is set to 1.Syntax
<webCheck CodeFile=ScriptFile RetFile=OutputFile RetVar=#r#>Remarks
Example
<webSet #TempFile#=#GetTempFileName()#><webCheck CodeFile="/test.wml" RetFile=#TempFile# RetVar=#RT#>
<webIf #RT=0#>
<webPrint File=#TempFile# HTMLFormat="On">
</webPrint>
<webFileDelete Name=#TempFile#>
</webIf>
Description
Provides PGP (Pretty Good Privacy) encryption.Syntax
General format:To do decryption, use this format:
Ret=#Num# >
To do Sign, use this format:
UserID=#ID#
PassPhrase=#Password#
ToVar=#
Varible
#
Ret=#Num# >
Argument |
Required |
Description |
DomainName IPAddress |
Yes |
The domain name or standard 32-bit IP address of the host to which you want to connect. |
Action |
Yes |
Encryption , Decryption or Sign |
Port |
Yes |
The protocol port of the remote machine. |
FromFile |
Yes |
The file containing the information to be encrypted |
FromText |
Yes |
The text string to be encrypted |
ToFile |
Yes |
The file to store the encrypted content |
ToVar |
Yes |
The variable to store the encrypted content |
Result |
Yes |
A variable will be set to 1 if the socket is successfully opened or 0 if it is not. |
TimeOut |
No |
The maximum time Web+ will wait for the connection to be made before returning an error message. By default, it will use the time under the SocketTimeOut keyname in the file WEBPSVR.INI.. |
Remarks
Set the following Variables and Values pairs (Control Panel | System | Environment if in NT 4.0):
PGPPATH=c:\pgp262
PATH=c:\pgp262
pgp -kxa UsedID
<webPgp Action="Addkey" FromFile=...>
to add this public key in his keyring. For you, it is alreay added in the keyring.Example
<webPGP Action="Encrypt" FromText="Hello" ToVar=#XY# UserIDs="Ming" Ret=#OK#>-------------------------------------------------
<webPGP Action="Decrypt" FromFile="/test.pgp" PassPhrase="WebPlus"
ToVar=#XY# Ret=#OK#>
<webIf #OK#>
<webPrint>
#XY#<BR>
</webPrint>
</webIf>
-------------------------------------------------
<webPGP Action="Sign" FromFile="/test.txt" UserID="WebPlus"
PassPhrase="WebPlus" ToVar=#XY# Ret=#OK#>
<webIf #OK#>
<webPrint>
#XY#<BR>
</webPrint>
</webIf>
Description
Provide secure On-Line cash transaction .Syntax
<webCyberCashHost=host machine running CyberCash Register Server
Port=...
MerchantPassword=...
TransType="mauthonly" or "mauthcapture"
OrderID=a unique id
Price=...
CCNumber=...
CCExp=...
CCName=...
CCAddress=...
CCCity=...
CCState=...
CCZip=...
CCCountry=...
Timeout=...>
Argument |
Required |
Description |
Host |
Yes |
The domain name or standard 32-bit IP address of the host to which you want to connect. Required. Host name ("mail.talentsoft.com") or IP address ("198.36.217.2") of the POP server. |
Port |
No |
The protocol port of the POP server. Optional attribute. |
UserName |
No |
Optional. If no user name is specified, the POP connection will be anonymous. |
Password |
No |
Optional. Password corresponds to user name. |
Action |
No |
Optional. Specifies the mail action. There are three possible values: GETHEADERONLY (Default) Returns message header information only. GETALL Returns message header information, message text, and attachments if ATTACHMENTPATH is specified. DELETE Deletes messages on the POP server. Note: Two retrieve options are offered to maximize performance. Message header information is typically short and therefore quick to transfer. Message text and attachments can be very long and therefore take longer to process. |
Name |
No |
The name you assign to the index query. Required for ACTION=GETHEADERONLY and ACTION=GETALL. |
MessageNumber |
No |
Optional. Specifies the message number(s) for the given action. MESSAGENUMBER is required for ACTION=DELETE. If it is provided for ACTION=GETHEADERONLY or ACTION=GETALL, only referenced messages will be retrieved. MESSAGENUMBER can contain individual message numbers or a comma separated list of message numbers. Invalid message numbers will be ignored. |
AttachmentPath |
No |
Optional. Allows attachments to be written to the specified directory when ACTION=GETALL. If an invalid ATTACHMENTPATH is specified, no attachment files are written to the server. |
TimeOut |
No |
Optional. Specifies the maximum amount of time in seconds to wait for mail processing. Defaults to 60 seconds. |
MaxRows |
No |
Optional. Specifies the maximum number of entries for mail queries. This attribute is ignored if MESSAGENUMBER is specified. |
StartRow |
No |
Optional. Specifies the first row number to be retrieved. Default is 1. This attribute is ignored if MESSAGENUMBER is specified. |
Remarks
A new feature was implemented for these version (only client/server
version). It is <webCyberCash ...>. The exact format is(
A * is intentially put before the options required):
<webCyberCash
* Server=Host name or IP address of the CyberCash CashRegister Server
Port=Optional. Default is 8000
* MerchantPassword=The secret key for a given merchant
TransType=Optional. Specifies the transaction type. There are two
possible values:
mauthonly -- (Default) Performs credit card authorization only
mauthcapture -- Performs credit card authorization and
captures the transaction
* OrderID=Identifies the transaction. It is a developer supplied value
used to uniquely identify the transaction. Maximum length of
this string is 32 or will be truncated
* Price=Specifies the amount, and optionally, the currency of the
transaction. Currencies are specified using ISO 4217 code in the
form "xxx 5.50" where "xxx" is the ISO 4217 code. US Dollar
("usd") is the default. Specifying "4.50" is equivalent to
"usd 4.5". Maximum length is 50. Pls note price should be a
string.
* CCNumber=Specifies the credit card number. All relavent information
about the card (type, bank, ..) can be determined from this
number. Spaces and dashes are allowed to simply processing. For
example, 1234-2345-3456-4567 is equivalent to 1234 2345 3456
4567 and to 1234234534564567.
* CCExp=Specifies the credit card expiration date in the form mm/yy where
"mm" isthe numeric form of the month and "yy" is the numeric form
of the year. For example, "04/98". The maximum length is 5.
CCName=Name of the credit card. Maximum length is 2
CCAddress=Address of the card holder. Maximum length is 50
CCCity=City of the card holder. Maximum length is 50
CCState=State of the card holder. Maximum length is 2.
CCZip=Postal code of the card holder. Maximum length is 50
CCCountry=Country of the origin of the card holder
TimeOut=Maximum Seconds to try to connect to CyberCash server.
Default
is 30.
>
Note that all option should be strings of format "xxxxx" except Port and
TimeOut.
This tag will always set two Web+ variables after its successful
execution. They are #MStatus# and #MErrMsg#.
MStatus: The Status field returned by the CyberCash CashRegister server.
Following are some of the possible values:
1. success -- Operation succeeded
2. failured-hard -- Operation failed
3. failured-q-or-cancel -- Operation failed due to communication
problem, but can be retried
4. failured-q-or-discard -- Operation failed due to communication
problem, but can be retried
5. failured-swversion -- Operation failured due to bad software
version
6. failure-bad-money -- Operation failed due to credit problem with
bank
MErrMsg: If operation was not successful, this contains the error
message as returned by CyberCash for this transaction
Apart from these values, all other variables retuened depend on the
version of CyberCash server you are using. The only difference is that all
"-" characters are changed to "_" to comform to Web+'s variable name
convention. Consult the CyberCash document for the particular version you
are using.
Example
<webCyberCash Server="n44.cs.fiu.edu" MerchantPassword="secret-test-ckfre"TransType="mauthonly"
OrderID="12345" Price="usd 4.5" CCNumber="xxxx"
CCExp="04/98"
CCName="VI" CCAddress="41 Street" CCCity="Miami"
CCState="FL" CCCountry="USA">
<webPrint>
#MStatus#<BR>
#MErrMsg#<BR>
</webPrint>
Description cause certain GIF image(usually number images) to be displayed which will
show the total visits on the current page.
Syntax
<webCounter Value=#num# [FrameThick=6][FrameColor="128,0,0"][DigitStyle=][UseStrip=]>
Argument |
Required |
Description |
Value |
Yes |
|
FrameThick |
No |
|
FrameColor |
No |
|
DigitStyel |
No |
Optional. A,B,C,D,or E. |
UseStrip |
No |
1 or 0 |
Remarks In order to make webCounter work:
1. Add one item in webpsvr.ini in [Main] section
CounterGifPath=c:\webplus\digits(maybe other path)
which defines the path where all the image files holded there.
2. Add one .ini file(may called counterfile.ini) in the same directory with
counter.wml, which is a text file, its content is at least :
[counter]
totalvisits=10(could be any number)
Example The following is counter.wml:
<webGetProfile File="/user1/Testwebplus40/counterfile.ini" Section="counter" Key="#count#" Result=#oldCount# Password="counter">
<webset #newCount# = #if(IsNumeric(oldCount),oldCount+1,1)#>
<webPutProfile File="/user1/Testwebplus40/counterfile.ini" Section="counter" Key="#count#" Value=#newCount# Password="counter">
<webContent Type="image/gif">
<webCounter Value="#newCount#" FrameThick=0 FrameColor="250,0,10" UseStrip=1 DigitStyle="A">
The following is counterfile.ini:
[counter]
totalvisit=15(could be any number)
The following is visit.wml:
<html>
<head><title> TalentSoft Counter </title></head>
<body bgcolor=
"#FFFFFF" text="#000000" link="#4400AA" alink="#FFFFFF" vlink="666666"><center>This site has been visited
<img src="/cgi-bin/webplus.exe?script=/user1/Testwebplus40/counter.wml&count=totalvisit">
times.
</center>
</body>
</html>
The only work need to be done is coping all above files, put into same directory and run visit.wml.
Description
Make sure only one process can enter critical section at the same time.Syntax
<webSynchronized>[statementblock]
</webSynchronized>
Example
<webSynchronized>Remarks
In order to do error handling, add the following intowebpmsg.ini:
;
Synchronization error14010c=WebSynchronized error as of nested usage
14010e=Web+ does not support nested WebSynchronized usage
14010t=Please make sure there is no nested WebSynchronized
14020c=Unbalanced WebSynchronized
14020e=<webSynchronized> and </webSynchronized> must be balanced
14020t=Please make sure for every <webSynchronized>, there must be a
corresponding </webSynchronized>
Description
Used to implement server push for those browsers support this feature.Syntax
<webPushPage ConTentType= >
</webPushPage Exit>
Argument |
Required |
Description |
ContentType |
No |
Default is "text/html". Exit means this is last page of the whole push page. |
Remarks
See Also
Example <webSet #I#=0>
Description Suspend the execution of a script for a designated time.
Syntax <webSleep Seconds= >
Example
<websleep Seconds=10>Remarks
Add Key in [Main] section of webpsvr.ini (ServerPushPassword=)
This tag mainly is in support of server push. For server push, usually the
script will runs for a long time, and generate and HTML page once in a
while. Between the consecutive pages, use <webSleep ...> to
suspend the execution.
Description
show crystal report files on web browser if Crystal Reports Engine (CRPE32.DLL) has been installed in SYSTEM32 directory of your PC.Syntax
<webReport Report=... UrlBase=... DirForUrlBase=... Datasource=...
Argument |
Required |
Description |
Report |
Yes |
Logical full name of report file |
UrlBase |
No |
The Url directory you want the web server consider webReports output. The default is root/. |
DirForUrlBase |
No |
The physical directory for the url directory above. Default is the WSHTMLRoot defined in webpsvr.ini file. These two Url attributes are used when there are images in the report files, so Web+ will generate the image files in directory DirForUrlBase and the reference in the HTML file based on UrlBase will work correctly. |
Datasource |
No |
datasource name. Optional. Usually no need to redefine it. |
OrderBy |
No |
Crystal's Order by expression. |
Example
<webReport report="/student.rpt">{STUDENT.last_name} IN "Naboulsi" and {STUDENT.birth_year} > 1969
</webReport>
Remark
Description Used to enable or disable client state management
. One can use client variable and it is persistent.Syntax
<webClient Name=SessionName [Persistent=0|1] [UCID="cookie"|"IP"|CustomIDExpression]>
Argument |
Required |
Description |
Name |
Yes |
Logical full name of report file |
Persistent |
No |
Persistent=1 will enable client state management. Default is 1. Persistent=0 will disable it. |
UCID |
No |
UCID, user client ID, defines how you want to track the client ID. There are 3 possible values for UCID: 1. "cookie" 2. "IP" 3. Any Custom ID Expression Default is "cookie". If your browser does not support, you should use "IP" |
Remark
Example
<webClient Name="Test" UCID="cookie"><webSet #test.Var1# = "1234">
Form Field Validation Suffixes
To use form field validation, add the appropriate field suffix to the corresponding variable name in an input tag of type=hidden. The value of this input tag is usually a custom error message (e.g., "Please enter a valid number.") except for the "_range" suffix. The value parameter for the "_range" suffix should look like this: "MIN=5 MAX=15".
Field Suffix |
Value Attribute |
Explanation |
||
_required |
Custom error message |
Verifies that some entries are required by the user. |
||
_integer |
Custom error message |
Verifies that a number is entered, if the user enters a floating point value it is rounded to an integer. |
||
_float |
Custom error message |
Verifies that a number is entered, if the users entersa floating point value, it does not round it up. |
||
_range |
MIN=MinValue |
Verifies that the numeric value entered is within the specified boundaries. One or both of the boundaries (MIN and MAX) may be specified. |
||
_date |
Custom error message |
Verifies that a date of one of the following formats is entered by the user: MM/DD/YY, MM/DD/YYYY, MM/DD (assumes current year). Dash (-) separated dates are also supported. |
||
_mask=maskstring |
Custom error message |
Maskstring |
||
0 |
Digit placeholder. One digit only |
|||
? |
Digit placeholder. Zero or more digit. |
|||
. |
Decimal placeholder. |
|||
, |
Thousand placeholder |
|||
: |
Time separator |
|||
/ |
Date |
|||
\ |
Treat the next character in the mask string as a literal. This allows you to include the '?', '&', etc in the mask C. |
|||
C |
Character placeholder. One character only. Valid values for Placeholder. |
|||
C |
Character placeholder. Zero or more characters. |
|||
A |
Alphanumeric character placeholder. e.g. a-z, A-Z, 0-9. |
|||
A |
Alphanumeric character placeholder. Zero or more alphanumeric characters. |
|||
Z |
Letter placeholder. One letter only. e.g. a-z or A-Z |
|||
Z |
Letter placeholder. Zero or more letters. |
|||
| |
OR separator. Either nothing, or one of the items must be selected. e.g. Y|N, M|F, A|B|C|D |
Variable Type |
Explanation |
Form Fields |
The most common way of passing parameters to scripts is using form fields. When a user enters data in a form field, a parameter bearing the name of the form field is passed to the script. |
URL Parameters |
Parameters are encoded after the script name in the URL (e.g., /cgi-bin/webplus.exe) using a key=value format. |
CGI Environment |
Every request sent to a CGI script has several environment variables sent to it that relate to the context in which it was sent. The variables available to you depend upon the browser and server software in use for a given request. |
WebSet Variables |
The webSet tag defines a variable that is then available for use within the rest of the script. |
HTTP Cookies |
HTTP Cookie variables are global variables that are available to any script interacting with the browser in which the cookie is set. They are created using the webCOOKIE tag. |
Queries |
As soon as a query has been run you can use its results as dynamic parameters in other queries. For example, if you create a query named 'LookupUser' which finds the ID for a user given their name you might want to use this ID in another query. To do this, use the name of the query followed by a dot and the name of the field (e.g., #LookupUser.User_ID#). |
Resolving ambiguities in variable names
It is possible for several variables with the same name to be included in your scripts. For example, you may write a script which contains a
<webSet> statement setting the value of the variable x. A user running your script might then submit a different value for x in a form. To distinguish between different variables of the same name, you can use the following prefixes with your variable names:
Use this prefix: |
To return the value of: |
#QueryName.VariableName# |
variable returned by the given query |
#Variables.VariableName# |
variable set by a <webSet> statement |
#Form.VariableName# |
form variable |
#URL.VariableName# |
variable entered in URL |
#Cookie.VariableName# |
cookie variable |
#CGI.VariableName# |
CGI variable |
If two or more of the above exist and you use #
Appendix A - ANSI Character Set
## - Represents a non-printable character.
** - ANSI value 8 is a Backspace, value 9 is a Tab, value 10 is a Linefeed, and value 13 is a Carriage Return.
0 ## |
1 ## |
2 ## |
3 ## |
4 ## |
5 ## |
6 ## |
7 ## |
8 ** |
9 ** |
10 ** |
11 ## |
12 ## |
13 ** |
14 ## |
15 ## |
16 ## |
17 ## |
18 ## |
19 ## |
20 ## |
21 ## |
22 ## |
23 ## |
24 ## |
25 ## |
26 ## |
27 ## |
28 ## |
29 ## |
30 ## |
31 ## |
32 |
33 ! |
34 " |
35 # |
36 $ |
37 % |
38 & |
39 ' |
40 ( |
41 ) |
42 * |
43 + |
44 , |
45 - |
46 . |
47 / |
48 0 |
49 1 |
50 2 |
51 3 |
52 4 |
53 5 |
54 6 |
55 7 |
56 8 |
57 9 |
58 : |
59 ; |
60 < |
61 = |
62 > |
63 ? |
64 @ |
65 A |
66 B |
67 C |
68 D |
69 E |
70 F |
71 G |
72 H |
73 I |
74 J |
75 K |
76 L |
77 M |
78 N |
79 O |
80 P |
81 Q |
82 R |
83 S |
84 T |
85 U |
86 V |
87 W |
88 X |
89 Y |
90 Z |
91 [ |
92 \ |
93 ] |
94 ^ |
95 _ |
96 ` |
97 a |
98 b |
99 c |
100 d |
101 e |
102 f |
103 g |
104 h |
105 I |
106 j |
107 k |
108 l |
109 m |
110 n |
111 o |
112 p |
113 q |
114 r |
115 s |
116 t |
117 u |
118 v |
119 w |
120 x |
121 y |
122 z |
123 { |
124 | |
125 } |
126 ~ |
127 ## |
128 ## |
129 ## |
130 ## |
131 ## |
132 ## |
133 ## |
134 ## |
135 ## |
136 ## |
137 ## |
138 ## |
139 ## |
140 ## |
141 ## |
142 ## |
143 ## |
144 ## |
145 |
146 |
147 " |
148 " |
149 |
150 |
151 |
152 |
153 ™ |
154 |
155 |
156 |
157 ## |
158 ## |
159 |
160 |
161 ‘ |
162 ’ |
163 £ |
164 € |
165 ₯ |
166 ¦ |
167 § |
168 ¨ |
169 © |
170 ͺ |
171 « |
172 ¬ |
173 |
174 ® |
175 ― |
176 ° |
177 ± |
178 ² |
179 ³ |
180 ΄ |
181 ΅ |
182 Ά |
183 · |
184 Έ |
185 Ή |
186 Ί |
187 » |
188 Ό |
189 ½ |
190 Ύ |
191 Ώ |
192 À |
193 Á |
194 Â |
195 Ã |
196 Ä |
197 Å |
198 Æ |
199 Ç |
200 È |
201 É |
202 Ê |
203 Ë |
204 Ì |
205 Í |
206 Î |
207 Ï |
208 Ð |
209 Ñ |
210 Ò |
211 Ó |
212 Ô |
213 Õ |
214 Ö |
215 Χ |
216 Ø |
217 Ù |
218 Ú |
219 Û |
220 Ü |
221 Ý |
222 Þ |
223 ß |
224 à |
225 á |
226 â |
227 ã |
228 ä |
229 å |
230 æ |
231 ç |
232 è |
233 é |
234 ê |
235 ë |
236 ì |
237 í |
238 î |
239 ï |
240 ð |
241 ñ |
242 ò |
243 ó |
244 ô |
245 õ |
246 ö |
247 χ |
248 ø |
249 ù |
250 ú |
251 û |
252 ü |
253 ý |
254 þ |
255 ÿ |
Description
The <FORM> tag starts the form. A document can consist of multiple forms, but forms cannot be nested; that is, no form can be placed inside another form.Syntax <FORM ACTION="/cgi-bin/webplus.exe?script=filename.wml" METHOD="POST">
Argument |
Required |
Description |
ACTION |
Yes |
The URL of the CGI program that will process the form information. |
METHOD |
Yes |
METHOD specifies how the server will send the form information to the program. There are two HTTP methods used to submit the form: POST - sends the data through standard input. GET(default) - passes information through environment variables. |
ENCTYPE |
No |
The encoding scheme for the POST data. There are two ENCTYPES are allowed: application/x-www-form-urlencoded (default)and multipart/form-data. |
Remarks
Example
</FORM>
Description
Most form elements are implemented using <INPUT> tag. It specifies different type of input is being requestedSyntax <INPUT TYPE="type" NAME="name" SIZE="size" VALUE="value" MAXLENGTH="maxlength">
Argument |
Required |
Description |
TYPE |
Yes |
It specifies the type of input is being requested Types of elements are available: text, password, hidden, radio, checkbox, submit and reset. |
NAME |
Yes |
The NAME attribute defines the name of the particular input element. |
SIZE |
No |
The displayed size of the input field. |
MAXLENGTH |
No |
Defines the maximum number of characters that will be accepted by the browser. By default, there is no limit. |
VALUE |
No |
It is used to insert a default value into the field. |
Remarks
Example
Description
The SELECT tag is used to specify a list box whereas, the OPTION tag is used to specify the elements in the box.Syntax <SELECT NAME="name">
<OPTION VALUE="option1" [SELECTED]>option1
<OPTION VALUE="option2">option2
</SELECT>
Argument |
Required |
Description |
VALUE |
No |
It is used to insert a default value into the field. |
SELECTED |
No |
It indicates the option that is initially selected. |
Remarks
Example
<OPTION VALUE="webplus2.1">Web+2.1
<OPTION VALUE="webplus3.0">Web+3.0
</SELECT>
Description
The TEXTAREA tag creates a scrolled text field.Syntax <TEXTAREA NAME="GuestBook" ROWS=10 COLS=40>
</TEXTAREA>
Argument |
Required |
Description |
ROWS |
Yes |
The number of rows in the text box. |
COLS |
Yes |
The number of columns in the text box. |
NAME |
Yes |
The NAME attribute defines the name of the particular input element. |
Example
<TEXTAREA NAME="GUESTBOOK" ROWS=10 COLS=40></TEXTAREA>
Form Tag |
Description |
<FORM ACTION="/cgi-bin/webplus.exe?script=/webplus.wml METHOD="POST"> |
Start the Form |
<INPUT TYPE="text" NAME="name" VALUE="value" SIZE="size"> |
Text field |
<INPUT TYPE="password" NAME="name" VALUE="value" SIZE="size"> |
Password field |
<INPUT TYPE="hidden" NAME="name" VALUE="value" SIZE="size"> |
Hidden field |
<INPUT TYPE="checkbox" NAME="name" VALUE="value" SIZE="size"> |
Checkbox |
<INPUT TYPE="radio" NAME="name" VALUE="value" SIZE="size"> |
Radio button |
<SELECT NAME="name" SIZE=1> <OPTION VALUE="value" SELECTED>Web+ 2.1 <OPTION VALUE="value">Web+ 3.0 : </SELECT> |
Menu |
<SELECT NAME="name" SIZE=n MULTIPLE> |
Scrolled list |
<TEXTAREA ROWS=yy COLS=xx NAME="name"> .... </TEXTAREA> |
Multiline text fields |
<INPUT TYPE="submit" NAME="name" VALUE="value" > |
Submit button |
<INPUT TYPE="image" SRC="/image" NAME="name" VALUE="value"> |
|
<INPUT TYPE="reset" VALUE="value"> |
Reset button |
</FORM> |
Ends Form |