Wascal Script IDE (v1.0.3) Programmers API
Copyright 2013-2014 Derek John Evans
This page was auto generated: 16/08/2014 4:29:45
Wascal Libraries

Wascal Script Types
Boolean = System.Boolean // Default boolean type.
Char = System.Char; // Default character type.
ShortInt = System.ShortInt; // Signed 8bit type.
SmallInt = System.SmallInt; // Signed 16bit type.
Longint = System.Longint; // Signed 32bit type.
Integer = System.Integer; // Signed 32bit type.
Int64 = System.Int64; // Signed 64bit type.
Byte = System.Byte; // Unasigned 8bit type.
Word = System.Word; // Unsigned 16bit type.
Cardinal = System.Cardinal; // Unasigned 32bit type.
Int8 = ShortInt; // Signed 8bit type.
Int16 = SmallInt; // Signed 16bit type.
Int32 = Longint; // Signed 32bit type.
UInt8 = Byte; // Unasigned 8bit type.
UInt16 = Word; // Unsigned 16bit type.
UInt32 = Cardinal; // Unasigned 32bit type.
DWord = Cardinal; // Unasigned 32bit type.
Single = System.Single; // 32bit float type.
Double = Single.Double; // 64bit float type.
String = array of Char; // The default Wascal string type.
TSysCharSet = set of Char;
TIntegerDynArray = array of Integer;
TCardinalDynArray = array of Cardinal;
TWordDynArray = array of Word;
TSmallIntDynArray = array of SmallInt;
TByteDynArray = array of Byte;
TShortIntDynArray = array of ShortInt;
TInt64DynArray = array of Int64;
TLongWordDynArray = array of LongWord;
TSingleDynArray = array of Single;
TDoubleDynArray = array of Double; 
TBooleanDynArray = array of Boolean;
TStringDynArray = array of AnsiString;  
TVariantDynArray = array of Variant;
TFileName = String;
TFilePath = String;
TFileExt = String;
TDateTime = Double;
TDate = Double;
TTime = Double;
TIFException = (ErNoError, erCannotImport, erInvalidType, ErInternalError, erInvalidHeader, erInvalidOpcode, erInvalidOpcodeParameter, erNoMainProc, erOutOfGlobalVarsRange, erOutOfProcRange, ErOutOfRange, erOutOfStackRange, ErTypeMismatch, erUnexpectedEof, erVersionError, ErDivideByZero, ErMathError, erCouldNotCallProc, erOutofRecordRange, erOutOfMemory, erException, erNullPointerException, erNullVariantError, erInterfaceNotSupported, erCustomError)

(back to top)
procedure WriteHtml(const AHtml: Variant);
Writes raw HTML out to the server.
procedure WriteCss(const AName: String; const ACfg: Variant);
...
procedure BlankScreen;
Blanks the screen buffer. Doesn't add any CSS styles.
procedure ClearScreenFontSize(const AFontSize: Integer);
Clears the screen buffer. Adds standard Wascal CSS styles. Set the base font size.
procedure ClearScreen;
Clears the screen buffer. Adds standard Wascal CSS styles.
procedure WriteText or Write(const AText: Variant);
Writes unformated text.
procedure WriteDiv(const AClass, AText: Variant);
Writes a DIV tag with the given text.
procedure WriteSpan(const AClass, AText: Variant);
Writes a SPAN tag with the given text.
procedure WriteH1(const AText: Variant);
Writes a H1 class DIV with the given text.
procedure WriteH2(const AText: Variant);
Writes a H2 class DIV with the given text.
procedure WriteH3(const AText: Variant);
Writes a H3 class DIV with the given text.
procedure WriteH4(const AText: Variant);
Writes a H4 class DIV with the given text.
procedure WriteLn(const AText: Variant);
Writes a LN class DIV with the given text.
procedure WriteLabel(const AText: Variant);
Writes a label class DIV with the given text.
procedure WriteTerminal(const AText: Variant);
...
procedure WriteTerminalDump(const AVar: Variant);
...
procedure Read(const AWab: Variant);
Reads the value of the given server variable name. (Doesn't include a newline)
procedure ReadLn(const AWab: Variant);
Reads the value of the given server variable name. (Includes a newline)

(back to top)
procedure WriteError(const AVar: Variant);
Writes a message box error.
procedure WriteAbout(const AVar: Variant);
Writes an about message inside a message box.
procedure WriteException;
Writes the last exception inside an error class.
procedure WriteMessage(const AVar: Variant);
Writes a message inside a message box class.
procedure WriteMessageBox(const AVar, ABtns: Variant);
Writes a messagebox with the array of buttons.
function Confirm(const AStr: String): Boolean;
Displays a confirmation message asking for a yes/no answer.
procedure Alert(const AStr: String);
...

(back to top)
procedure BeginTableClass(const AClass: Variant);
...
procedure EndTable;
...
procedure BeginTR;
...
procedure EndTR;
...
procedure BeginTH;
...
procedure EndTH;
...
procedure BeginTD;
...
procedure EndTD;
...
procedure WriteCellFlow(const AHtml: Variant; var ACol: Integer; const AMaxCol: Integer);
...
procedure EndCellFlow(const AHtml: Variant; var ACol: Integer; const AMaxCol: Integer);
...
procedure WriteTableClassColNames(const ACsv, AClass, AColNames: Variant);
...
procedure WriteTableClass(const ACsv, AClass: Variant);
...
procedure WriteTable(const ACsv: Variant);
...

(back to top)
procedure InterfaceBegin;
...
procedure InterfaceAdd(const APrompt, AWab: Variant);
...
procedure InterfaceEnd;
...

(back to top)
procedure BeginModalScreen;
...
procedure EndModalScreen;
...
procedure BeginModalDialog(const ATitle: String; const AWidth, AHeight: Integer);
...
procedure EndModalDialog(const AButtons: Variant);
...

(back to top)
procedure PromptCfg(const ACfg: Variant);
Prompt user for fields defines as a cfg array.
procedure Prompt(const APrompt, AWab: Variant);
Prompt the user for a variable given its name and a message prompt as raw HTML.
procedure PromptLogin(const ATitle, AWebUsername, AWebPassword: String);
...
procedure PromptDate(const APrompt, AWab: String);
Prompt the user for a date.
procedure PromptHourMinute(const APrompt, AWab: String);
Prompt the user for a time as hours and minutes.

(back to top)
function SqlName(const AVar: Variant): String;
...
function SqlValue(const AVar: Variant): String;
...
function SqlNames(const ATxt: Variant): String;
...
function SqlValues(const ATxt: Variant): String;
...
function SqlNameValues(const ACfg: Variant): String;
...
function SqlDrop(const AWhat, AName: String): String;
...
function SqlDropDatabase(const AName: String): String;
...
function SqlDropTable(const AName: String): String;
...
function SqlCreateDatabase(const AName: String): String;
...
function SqlCreateTable(const AName: String; const ACfg: Variant): String;
...
function SqlInsertInto(const AName: String; const ACfg: Variant): String;
...

(back to top)
function DbsDatabase(const AInterface, AHost, APort, AUser, APass, AName: String): String;
...
function DbsResultError(const AResult: Variant): Variant;
...
function DbsResultInfo(const AResult: Variant): Variant;
...
function DbsResultTable(const AResult: Variant): Variant;
...
function DbsQuery(const ADbs, ASql: String): Variant;
...
function DbsDropTable(const ADbs, AName: String): Variant;
...
function DbsCreateDatabase(const ADbs, AName: String): Variant;
...
function DbsCreateTable(const ADbs, AName: String; const ACfg: Variant): Variant;
...
function DbsInsertInto(const ADbs, AName: String; const ACfg: Variant): Variant;
...
procedure DbsResultWrite(const AResult: Variant);
...

(back to top)
procedure BeginControl;
...
procedure EndControl;
...
procedure BeginControlToolbar(const AButtons: Variant);
...
procedure EndControlToolbar;
...
procedure WriteControlTable(const AClass, ATable, AColNames, AWabClick: Variant);
...

(back to top)
procedure AnsiDelete or Delete(var AStr: String; const AIdx, ACount: Integer);
Delete part of a string.
procedure AnsiInsert or Insert(const ASubStr: String; var AStr: String; const AIdx: Integer);
Insert one string in another.
function AnsiPos or Pos(const ASubStr, AStr: String): Integer;
Search for substring in a string.
function AnsiPosEx or PosEx(const ASubStr, AStr: String; const AIdx: Integer): Integer;
Search for the occurance of a character in a string, starting at a certain position.
function AnsiRPos or RPos(const ASubStr, AStr: String): Integer;
...
function AnsiRPosEx or RPosEx(const ASubStr, AStr: String; const AIdx: Integer): Integer;
...
function AnsiReplaceStr or ReplaceStr(const AStr, AFromString, AToString: String): String;
Replaces all strings found to new string.
function AnsiReplaceText or ReplaceText(const AStr, AFromString, AToString: String): String;
Replaces all strings found to new string
function AnsiSameStr or SameStr(const A, B: String): Boolean;
Checks whether 2 strings are the same
function AnsiSameText or SameText(const A, B: String): Boolean;
Checks whether 2 strings are the same (case insensitive).
function AnsiFormat or Format(const AFmt: String; const AArgs: array of const): String;
Format a string with given arguments.
function AnsiStuffString or StuffString(const AText: String; const AStart, ALength: Cardinal; const ASubText: String): String;
...
function AnsiReverseString or ReverseString(const AStr: String): String;
...
function AnsiTrim or Trim(const AStr: String): String;
Trim whitespace from the ends of a string.
function AnsiTrimLeft or TrimLeft(const AStr: String): String;
...
function AnsiTrimRight or TrimRight(const AStr: String): String;
...
function AnsiLeftStr or LeftStr(const AStr: String; const ACount: Integer): String;
Copies a number of characters starting at the left of a string
function AnsiRightStr or RightStr(const AStr: String; const ACount: Integer): String;
Copies a number of characters starting at the right of a string
function AnsiMidStr or MidStr(const AStr: String; const AIdx, ACount: Integer): String;
Returns a number of characters copied from a given location in a string. (Same as Copy(), but for strings only)
function AnsiPadLeft or PadLeft(const AStr: String; const AIdx: Integer): String;
Add spaces to the left of a string till a certain length is reached.
function AnsiPadRight or PadRight(const AStr: String; const AIdx: Integer): String;
Add spaces to the right of a string till a certain length is reached.
function AnsiPadCenter or PadCenter(const AStr: String; const AIdx: Integer): String;
Pad the string to a certain length, so the string is centered.
function AnsiStringOfChar or StringOfChar(const AChr: Char; const AIdx: Integer): String;
Return a string consisting of 1 character repeated N times.
function AnsiEndsStr(const ASubStr, AStr: String): Boolean;
...
function AnsiEndsText(const ASubStr, AStr: String): Boolean;
...
function AnsiStartsStr(const ASubStr, AStr: String): Boolean;
...
function AnsiStartsText(const ASubStr, AStr: String): Boolean;
...
function AnsiResemblesText(const AText, AOther: String): Boolean;
...
function AnsiXorDecode or XorDecode(const AKey, AStr: String): String;
...
function AnsiXorEncode or XorEncode(const AKey, AStr: String): String;
...
function AnsiContainsStr or ContainsStr(const AStr, ASubText: String): Boolean;
Checks whether a string contains a given substring.
function AnsiContainsText or ContainsText(const AStr, ASubText: String): Boolean;
Check whether a string contains a certain substring, ignoring case.
function AnsiProperCase or ProperCase(const AStr: String; const AWordDelims: TSysCharSet): String;
Pretty-Print a string: make lowercase and capitalize first letters of words.
function AnsiUpperCase or UpperCase(const AStr: String): String;
Return an uppercase version of a string, taking into account special characters.
function AnsiLowerCase or LowerCase(const AStr: String): String;
Return a lowercase version of a string.
function AnsiRestOf or StrRestOf(const AStr: String; const AIdx: Integer): String;
...
function AnsiStrIsAlpha(const AStr: String): Boolean;
...
function AnsiIntToStr or IntToStr(const AInt: Integer): String;
Convert an integer value to a decimal string.
function AnsiStrToInt or StrToInt(const AStr: String): Integer;
Convert a string to an integer value.
function AnsiStrToIntDef or StrToIntDef(const AStr: String; const ADef: Integer): Integer;
Convert a string to an integer value, with a default value.
function AnsiInt64ToStr or Int64ToStr(const AInt: Int64): String;
Convert an 64bit integer value to a decimal string.
function AnsiStrToInt64 or StrToInt64(const AStr: String): Int64;
Convert a string to an Int64 value.
function AnsiStrToInt64Def or StrToInt64Def(const AStr: String; const ADef: Int64): Int64;
Convert a string to an Int64 value, with a default value.
function AnsiStrToFloat or StrToFloat(const AStr: String): Extended;
Convert a string to a floating-point value.
function AnsiFloatToStr or FloatToStr(const AValue: Extended): String;
Convert a float value to a string using a fixed Format.
function AnsiIsValidIdent or IsValidIdent(const AStr: String): Boolean;
Check whether a string is a valid identifier name.

(back to top)
function VarTxtToTxt(const ATxt: Variant): String;
...
function VarTxtToCsv(const ATxt: Variant): String;
...

(back to top)
function VarCsvToCsv(const ACsv: Variant): String;
...

(back to top)
function VarCfgGetNames or CfgGetNames(const ACfg: Variant): Variant;
Return an array containing all the names of the attributes.
function VarCfgGetValues or CfgGetValues(const ACfg: Variant): Variant;
Return an array containing all the values of the attributes.
function VarCfgIndexOfName or CfgIndexOfName(const ACfg, AName: Variant): Integer;
Find a attribute name. Return its index or abort if not found.
function VarCfgIndexOfValue or CfgIndexOfValue(const ACfg, AValue: Variant): Integer;
Find a attribute value. Return its index or abort if not found.
procedure VarCfgSetValue or CfgSetValue(var ACfg: Variant; const AName, AValue: Variant);
Set a attributes value given its name. Create a new attribute if needed.
function VarCfgGetValue or CfgGetValue(const ACfg, AName: Variant): Variant;
Get a attribute value given its name. Abort if not found.
function VarCfgGetValueDef or CfgGetValueDef(const ACfg, AName, ADef: Variant): Variant;
Get a attribute value given its name. Return a default value if not found.
function VarCfgToCfg(const ACfg: Variant): String;
...
function VarCfgToTagAttrs(const ACfg: Variant): String;
...
function VarCfgToPar(const ACfg: Variant): String;
...

(back to top)
function VarIniGetSections or IniGetSections(const AIni: Variant): Variant;
Return an array of section names.
procedure VarIniSetValue or IniSetValue(var AIni: Variant; const ASection, AName, AValue: Variant);
Set a value of a ini array given its section, name and value.
function VarIniGetValue or IniGetValue(const AIni, ASection, AName: Variant): Variant;
Get a value from a ini array given its section and name. (Aborts if value not found)
function VarIniGetValueDef or IniGetValueDef(const AIni, ASection, AName, ADef: Variant): Variant;
Get a value from a ini array given its section and name. (Returns default value if not found)
function VarIniToIni(const AIni: Variant): String;
...

(back to top)
function VarXmlGetName or XmlGetName(const AXml: Variant): String;
...
function VarXmlGetCfg or XmlGetCfg(const AXml: Variant): Variant;
...
function VarXmlGetNodes or XmlGetNodes(const AXml: Variant): Variant;
...
function VarXmlGetTextHead or XmlGetTextHead(const AXml: Variant): String;
...
function VarXmlGetTextFoot or XmlGetTextFoot(const AXml: Variant): String;
...
function VarXmlGetText or XmlGetText(const AXml: Variant): String;
...
function VarXmlGetCfgValue or XmlGetCfgValue(const AXml: Variant; const AName: String): Variant;
...
function VarXmlGetCfgValueDef or XmlGetCfgValueDef(const AXml: Variant; const AName: String; const ADef: Variant): Variant;
...
function VarXmlGetCfgCount or XmlGetCfgCount(const AXml: Variant): Integer;
...
function VarXmlGetNodeCount or XmlGetNodeCount(const AXml: Variant): Integer;
...
function VarXmlGetNodeByIndex or XmlGetNodeByIndex(const AXml: Variant; const AIdx: Integer): Variant;
...
function VarXmlGetNodeIndex or XmlGetNodeIndex(const AXml, AName: Variant): Integer;
...
function VarXmlGetNodeByName or XmlGetNodeByName(const AXml, AName: Variant): Variant;
...
function VarXmlGetNodeByPath or XmlGetNodeByPath(const AXml: Variant; const APath: String): Variant;
...
function VarXmlGetNodeByPathAttrValue or XmlGetNodeByPathAttrValue(const AXml: Variant; const APath, AName: String): Variant;
...
function VarXmlGetNodeByPathAttrValueDef or XmlGetNodeByPathAttrValueDef(const AXml: Variant; const APath, AName: String; const ADef: Variant): Variant;
...
function VarXmlToXml(const AXml: Variant): String;
...

(back to top)
function Css(const AName: String; const AValue: Variant): String;
...

(back to top)
function CharIsWhiteSpace or IsSpace(const AChr: Char): Boolean;
Returns True if char is in set of spaces.
function CharIsDigit or IsDigit(const AChr: Char): Boolean;
Returns True if char is in set of digits.
function CharIsAlpha or IsAlpha(const AChr: Char): Boolean;
Returns True if char is in set of alpha's.
function CharIsLower or IsLower(const AChr: Char): Boolean;
Returns True if char is in set of lowercase alpha's.
function CharIsUpper or IsUpper(const AChr: Char): Boolean;
Returns True if char is in set of uppercase alpha's.
function CharIsOctal or IsOctal(const AChr: Char): Boolean;
...
function CharIsHexidecimal or IsHexidecimal(const AChr: Char): Boolean;
...
function CharIsIsASCII or IsASCII(const AChr: Char): Boolean;
...

(back to top)
function Now: TDateTime;
Returns the current date and time.
function Date: TDate;
Return the current date.
function Time: TTime;
Returns the current time.
function DateToStr(const ADate: TDate): String;
Converts a TDateTime value to a date string with a predefined Format.
function TimeToStr(const ATime: TTime): String;
Convert a TDateTime time to a string using a predefined Format.
function DateTimeToStr(const ADateTime: TDateTime): String;
Converts a TDateTime value to a string using a predefined Format.
function DateTimeToFileDate(const ADateTime: TDateTime): Longint;
Convert a TDateTime value to a file age (integer).
function FileDateToDateTime(const AFileDate: Longint): TDateTime;
Convert a FileDate value to a TDateTime value.

(back to top)
function IsValidXmlEncoding(const AStr: String): Boolean;
Validate a string for correct xml name encoding.
function IsXmlWhiteSpace(const AChar: Char): Boolean;
Return True if char is a valid white space.
function StrToXMLValue(const AStr: String): String;
Remove #0, encodes <>&'"
function XMLValueToStr(const AStr: String): String;
Reverse of StrToXMLValue (except for invalid #0)
function EscapeHTML(const AStr: String): String;
Encode a string to html.
function UnescapeHTML(const AStr: String): String;
Decode a string from html.
function HttpEncode(const AStr: String): String;
Encode string to http.
function HttpDecode(const AStr: String): String;
Decode string from http.
function JSONStringToString(const AStr: String): String;
Encode string to Json.
function StringToJSONString(const AStr: String): String;
Decode string from Json.
function EncodeStringBase64(const AStr: String): String;
Encode string to base 64.
function DecodeStringBase64(const AStr: String; const AStrict: Boolean): String;
Decode string from base 64.
function Serialize(const AVar: Variant): String;
Serialize a variant to php serialization format. (new and untested)
function Unserialize(const AStr: String): Variant;
Unserialize a string to a variant. (new and untested)

(back to top)
function ChangeFileExt(const AName, AExt: String): String;
Change the extension of a filename.
function ExtractFileName(const AName: String): String;
Extract the filename part from a full path filename.
function ExtractFileExt(const AName: String): String;
Return the extension from a filename.
function ExtractFilePath(const AName: String): String;
Extract the path from a filename.
function ExtractFileDir(const AName: String): String;
Extract the drive and directory part of a filename.
function ExtractRelativepath(const ABaseName, ADestName: String): String;
Extract a relative path from a filename, given a base directory.
function ExpandFileName(const AName: String): String;
Expand a relative filename to an absolute filename.
function FileIsInPath(const AName, APath: String): Boolean;
Return True if file is in given path.
function IncludeTrailingPathDelimiter(const AName: String): String;
Add trailing directory separator to a pathname, if needed.
function ExcludeTrailingPathDelimiter(const AName: String): String;
Strip trailing directory separator from a pathname, if needed.
function ConcatPaths(const APaths: array of String): String;
Concatenate an array of paths to form a single path.
function FileExists(const AName: String): Boolean;
Check whether a particular file exists in the filesystem.
function DirectoryExists(const AName: String): Boolean;
Check whether a directory exists in the file system.
function DeleteFile(const AName: String): Boolean;
Delete a file from the filesystem.
function RenameFile(const ANameOld, ANameNew: String): Boolean;
Rename a file.
function CopyFile(const ASrc, ADst: String): Boolean;
Copy a file.
function FileToString(const AName: TFilename): String;
Load a file into a string.
procedure StringToFile(const AName: TFilename; const AStr: String);
Save a string to a file.
function SameFileName(const S1, S2: String): Boolean;
Are two filenames referring to the same file ?
function CleanAndExpandFilename(const AName: String): String;
...
function CleanAndExpandDirectory(const AName: String): String;
...
function ForceDirectory(const AName: String): Boolean;
...
function RemoveDir(const AName: String): Boolean;
...
function CompareFileExt(const AName, AExt: String): Integer;
...
function DeleteDirectory(const AName: String; const AOnlyChildren: Boolean): Boolean;
...

(back to top)
function TagName(const AName: Variant): String;
HTML encode a HTML tag without attributes.
function TagNameAttrs(const AName, AAttrs: Variant): String;
HTML encode a HTML tag given its name and attributes.
function TagNameEnd(const AName: Variant): Variant;
HTML encode a tag end given its name. (Used for block tags)
function TagNameHtmlAttrs(const AName, AHtml, AAttrs: Variant): String;
HTML encode a block tag given its name, attributes and inner HTML.
function TagNameHtmlClass(const AName, AHtml, AClass: Variant): String;
...
function TagNameHtml(const AName, AHtml: Variant): String;
HTML encode a block tag given its name and inner HTML.
function TagNameTextAttrs(const AName, AText, AAttrs: Variant): String;
HTML encode a block tag given its name, attributes and inner text.
function TagNameText(const AName, AText: Variant): String;
HTML encode a block tag given its name and inner text.
function TagDocType: String;
Return the default Wascal Script doctype.
function TagHtml(const AHtml: String): String;
Encode a doctype tag.
function TagTitle(const ATitle: String): String;
Encode a TITLE tag.
function TagMeta(const AName, AContent: String): String;
...
function TagHead(const ATitle: String): String;
Encode a HEAD tag with the given title.
function TagBody(const AHtml: String): String;
Encode a BODY tag with the given inner HTML.
function TagDivHtmlClass(const AHtml, AClass: Variant): String;
Encode a DIV tag with the given class name and inner HTML.
function TagDivHtmlClassIcon(const AHtml, AClass: Variant; const AIcon: String): String;
...
function TagDivTextClass(const AText, AClass: Variant): String;
Encode a DIV tag with the given class name and inner text.
function TagDivHtmlError(const AHtml: Variant): String;
TODO: Should this remain?? HTML encodes a error message.
function TagSpanHtmlClass(const AHtml, AClass: Variant): String;
Encode a SPAN tag given its class and inner text.
function TagSpanTextClass(const AText, AClass: Variant): String;
Encode a SPAN tag given its class and inner text.
function TagLabelHtmlClass(const AHtml, AClass: Variant): String;
...
function TagScript(const AScript: Variant): String;
Encode a SCRIPT tag given its javascript.
function TagScriptSrc(const ASrc: Variant): String;
...
function TagIcon(const ASrc: Variant): String;
...
function TagInput(const AType, AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputEdit(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputPassword(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputFile(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputHidden(const AName, AValue: Variant; const AIsDisabled: Boolean): String;
...
function TagInputCheckBox(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputRadio(const AName, AValue, AClass, AHtml: Variant; const AIsChecked, AIsDisabled: Boolean): String;
...
function TagInputRadioGroup(const AName, AValue, AClass, AOptions: Variant; const AIsDisabled: Boolean): String;
...
function TagInputEditCalendar(const AName, AValue, AClass: Variant; const AIsDisabled, AShowTime: Boolean; const AFormat, AIcon: String): String;
...
function TagInputEditDate(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagInputEditDateTime(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagOption(const AValue, AHtml: Variant; const AIsSelected: Boolean): String;
Encode a OPTION tag given a name, value and selection state.
function TagSelect(const AName, AValue, AClass, AOptions: Variant; const AIsDisabled, AIsMultiple: Boolean): String;
...
function TagTextArea(const AName, AValue, AClass: Variant; const AIsDisabled: Boolean): String;
...
function TagTextAreaTinyMCE(const AName, AValue: Variant; const AIsDisabled: Boolean): String;
...
function TagButton(const AName, AValue, AClass, ACaption: Variant; const AIsDisabled: Boolean): String;
...
function TagAnchor(const AName, AValue, AClass, ACaption: Variant; const AIsDisabled: Boolean): String;
...
function TagLink(const AHRef, ARel, AType: Variant): String;
...
function TagLinkStyle(const AHRef: Variant): String;
...
function TagForm(const AHtml: Variant): String;
...
function TagTH(const AValue: Variant): String;
...
function TagTD(const AValue: Variant): String;
...

(back to top)
function HostName: String;
...
function IndyComputerName: String;
...
function IsHostname(const AStr: String): Boolean;
...
function IsIp(const AStr: String): Boolean;
...
function IsTopDomain(const AStr: String): Boolean;
...
function IsValidIp(const AStr: String): Boolean;
...
function LocalAddress: String;
...
function LocalAddresses: Variant;
...
function NormalizePath(const AStr: String): String;
...
function ParamsEncode(const AStr: String): String;
...
function PathEncode(const AStr: String): String;
...
function ResolveHost(const AStr: String): String;
...
function UrlDecode(const AStr: String): String;
...
function UrlEncode(const AStr: String): String;
...
function StrHtmlEncode(const AStr: String): String;
Encode characters representing pre-defined character entities for HTML 4. handles &<>" characters.
function StrHtmlDecode(const AStr: String): String;
Decode characters representing pre-defined character entities for HTML 4. handles &<>" characters.
function StrXHtmlEncode(const AStr: String): String;
Encode characters representing pre-defined character entities for HTML 4. handles &<>" characters.
function StrXHtmlDecode(const AStr: String): String;
Decode characters representing pre-defined character entities for HTML 4. handles &<>" characters.

(back to top)
function Random(const ACount: Integer): Integer;
Generate random number
procedure Randomize;
Initialize random number generator
function Pi: Extended;
Return the value of PI.
function Sin(const AValue: Extended): Extended;
Calculate sine of angle.
function Cos(const AValue: Extended): Extended;
Calculate cosine of angle.
function Sqrt(const AValue: Extended): Extended;
Calculate the square root of a value.
function Round(const AValue: Extended): Integer;
Round floating point value to nearest integer number.
function Trunc(const AValue: Extended): Integer;
Truncate a floating point value.
function Int(const AValue: Extended): Extended;
Calculate integer part of floating point.
function Abs(const AValue: Extended): Extended;
Calculate absolute value.
function MaxVariant or VarMax(const A, B: Variant): Variant;
Returns the max value of two variants.
function MinVariant or VarMin(const A, B: Variant): Variant;
Returns the min value of two variants.
function MaxInteger or MaxInt or IntMax(const A, B: Integer): Integer;
Returns the max value of two integers.
function MinInteger or MinInt or IntMin(const A, B: Integer): Integer;
Returns the min value of two integers.
function MaxSingle(const A, B: Single): Single;
Returns the max value of two singles.
function MinSingle(const A, B: Single): Single;
Returns the min value of two singles.
function IfThen or Iff(const AValue: Boolean; const A, B: String): String;
If value is True, then return A, else return B.

(back to top)
function ParseChar(const AStr: String; var APos: Integer): Char;
...
function ParseCharSet(const AStr: String; var APos: Integer; const ASet: TSysCharSet): Char;
...
function ParseThisChar(const AStr: String; const APos: Integer): Char;
...
function ParseThisString(const AStr: String; const APos, ALen: Integer): String;
...
function ParseThisToken(const AStr: String; const APos: Integer): String;
...
function ParseIfCharSet(const AStr: String; var APos: Integer; const ASet: TSysCharSet): Boolean;
...
function ParseIfNewLine(const AStr: String; var APos: Integer): Boolean;
...
function ParseIsCharSet(const AStr: String; const APos: Integer; const ASet: TSysCharSet): Boolean;
...
function ParseIsCharSet2(const AStr: String; const APos: Integer; const ASet1, ASet2: TSysCharSet): Boolean;
...
function ParseIsComment(const AStr: String; const APos: Integer): Boolean;
...
function ParseIsCommentCpp(const AStr: String; const APos: Integer): Boolean;
...
function ParseIsCommentIni(const AStr: String; const APos: Integer): Boolean;
...
function ParseIsEol(const AStr: String; const APos: Integer): Boolean;
...
function ParseIsNull(const AStr: String; const APos: Integer): Boolean;
...
function ParseString(const AStr: String; var APos: Integer; const AHead, ABody: TSysCharSet): String;
...
function ParseStringAttrName(const AStr: String; var APos: Integer): String;
...
function ParseStringLine(const AStr: String; var APos: Integer): String;
...
function ParseStringTagName(const AStr: String; var APos: Integer): String;
...
function ParseStringUntil(const AStr: String; var APos: Integer; const ASet: TSysCharSet): String;
...
function ParseStringUntilNull(const AStr: String; var APos: Integer): String;
...
function ParseUntil(const AStr: String; var APos: Integer; const ASet: TSysCharSet): Integer;
...
function ParseUntilWhiteSpaceOrNull(const AStr: String; var APos: Integer): Integer;
...
function ParseWhile(const AStr: String; var APos: Integer; const ASet: TSysCharSet): Integer;
...
function ParseWhileWhiteSpace(const AStr: String; var APos: Integer): Integer;
...
procedure ParseAssert(const ACondition: Boolean);
...

(back to top)
function ParseCfgToVarCfg or VarCfgFromCfg(const ACfg: String): Variant;
...
function ParseCsvToVarCsv or VarCsvFromCsv(const ACsv: String): Variant;
...
function ParseCsvToVarTxt or VarTxtFromCsv(const ACsv: String): Variant;
...
function ParseIniToVarIni or VarIniFromIni(const AIni: String): Variant;
...
function ParseParToVarCfg or VarCfgFromPar(const APar: String): Variant;
...
function ParseTxtToVarTxt or VarTxtFromTxt(const ATxt: String): Variant;
...
function ParseXmlToVarAny or VarAnyFromXml or VarFromXml(const AXml: String): Variant;
...
function ParseXmlToVarXml or VarXmlFromXml(const AXml: String): Variant;
...

(back to top)
function PrettyCss(const AStr: String): String;
...
function PrettyHtm(const AStr: String): String;
...
function PrettyIni(const AStr: String): String;
...
function PrettyPas(const AStr: String): String;
...

(back to top)
function QueryGetValue(const AQuery, AName: String): String;
...
function QueryGetValueDef(const AQuery, AName, ADefault: String): String;
...
procedure QuerySetValue(var AQuery: String; const AName, AValue: String);
...

(back to top)
procedure SetUrlExt(const AUrl: String; const AVar: Variant; const AExt: String);
Send data to the Wascal server.
procedure SetUrl(const AUrl: String; const AVar: Variant);
...
function GetUrlExt(const AUrl: String; const AExt: String): Variant;
Get data from the Wascal server (forces the given file ext type)
function GetUrl(const AUrl: String): Variant;
Get data from the Wascal server (Uses the file ext from the Url)
function GetUrlDef(const AUrl: String; const ADef: Variant): Variant;
Get data from the Wascal server. Returns a default value on failure.
procedure ServerCopyUrl or CopyUrl(const ADst, ASrc: String);
...
procedure ServerLog or Log(const AMessage: String);
Send a debug message to the Wascal IDE.
procedure SetVirtualPath(const ARemote, ALocal: String);
Set the value of a virtual path to a local file path.

(back to top)
function SessionId: String;
Return the id of the session.

(back to top)
procedure ProcessSuspend;
Suspend the current process.
procedure ProcessEcho or Echo(const AVar: Variant);
Add raw HTML to the processes HTML buffer.
procedure ProcessRedirect(const AUrl: String);
Redirect browser to the given location.
procedure ProcessUnauthorized(const AStr: String);
Request basic authentication.
function ProcessGetParam(const AName: Variant): Variant;
Get the value of a request param.

(back to top)
function Low(const AArg): TOrdinal;
Return lowest index of open array or enumerated.
function High(const AArg): TOrdinal;
Return highest index of open array or enumerated.
function ExecuteFunction(const AParams: array of Variant; const AName: String): Variant;
Execute a function.
function ExceptionType: TIFException;
Returns the type of the last exception.
function ExceptionParam: String;
Returns the last exception message param.
function ExceptionToString(const AException: TIFException; const AStr: String): String;
Returns the string encoding of an exception.
procedure Abort;
Raises an abort exception.
procedure Assert(const ACondition: Boolean);
Assert a condition is True. Otherwise raise assert exception.
procedure RaiseLastException;
Re-raise the last exception.
procedure RaiseException(const AException: TIFException; const AStr: String);
Raises an exception.
procedure RaiseMessageIf(const ACondition: Boolean; const AMsg: String);
Raise exception message if statement is not true.
procedure RaiseTypeMismatch(const AName, AType: String);
Uses by the system to indicate a type conversion mismatch.
procedure RaiseMessage(const AStr: String);
Raise a exception with the given message.
procedure RaiseCouldNotCallProc(const AStr: String);
Raise a CouldNotCallProc exception.

(back to top)
function GetEnvironmentString(const AIdx: Integer): String;
...
function GetEnvironmentVariable(const AName: String): String;
Return the value of an environment variable.
function GetTempDir: String;
Return name of system's temporary directory.
function GetUserDir: String;
Returns the current user's home directory.
function GetAppConfigDir(const AGlobal: Boolean): String;
...

(back to top)
function VarUri(const AProtocol, AUsername, APassword, AHost, APort, APath, ADocument, AParams, ABookmark: String): Variant;
Access to Indy's TIdUri class.
function VarUriToStrDef(const AUri: Variant; const ADef: String): String;
...
function VarUriToStr(const AUri: Variant): String;
...
function VarUriFromVar(const AUri: Variant): Variant;
...
function VarUriFromStr(const AUri: String): Variant;
...

(back to top)
function ResolveRelativeUri(const ABaseUri, ARelUri: String; out AResultUri: String): Boolean;
...
function UriToFilename(const AUri: String; out AFilename: String): Boolean;
...
function FilenameToUri(const AFilename: String; const AEncode: Boolean): String;
...
function IsAbsoluteUri(const AUriReference: String): Boolean;
...

(back to top)
function VarLstFromVariants(const ALst: array of Variant): Variant;
Create a variant list (array) from an array of variants.
function VarLstFromStrings(const ALst: array of String): Variant;
Create a variant list (array) from an array of strings.
function VarLstGetCount or Count(const ALst: Variant): Integer;
Return the number of items in an array. Returns 1 for all non arrays, except Unassigned, which returns 0.
procedure VarLstSetCount or SetCount(var ALst: Variant; const ALen: Integer);
Set the count of an array.
function VarLstGetItem or GetItem(const ALst: Variant; const AIdx: Integer): Variant;
Get a variant from an array. Return the array varaint if its NOT an array.
function VarLstGetItemDef or GetItemDef(const ALst: Variant; const AIdx: Integer; const ADef: Variant): Variant;
Get a variant from an array. Return the array varaint if its NOT an array.
function VarLstGetItemWrap or GetItemWrap(const ALst: Variant; const AIdx: Integer): Variant;
Get a variant from an array. This wraps the index to the array bounds.
function VarLstGetItemWrapDef or GetItemWrapDef(const ALst: Variant; const AIdx: Integer; const ADef: Variant): Variant;
...
procedure VarLstSetItem or SetItem(var ALst: Variant; const AIdx: Integer; const AValue: Variant);
Set a variant in an array. If array is NOT an array, then set it to value.
procedure VarLstSetCountAt(var ALst: Variant; const ALen, AIdx: Integer);
Increase or decrease the size of array by an amount at the given index.
function VarLstIndexOf(const ALst, AValue: Variant; const ACaseSensitive: Boolean): Integer;
Returns the index of an item. Aborts if not found.
procedure VarLstDelete(var ALst: Variant; const AIdx: Integer);
Delete a single value from an array given its index.
procedure VarLstRemove(var ALst: Variant; const ASrc: Variant; const ACaseSensitive: Boolean);
Removes a single value from an array given its value.
procedure VarLstInsert(var ALst: Variant; const ASrc: Variant; const AIdx: Integer);
Insert a value into an array at the given index.
procedure VarLstAppend(var ALst: Variant; const ASrc: Variant);
Append a value to the end of an array.
procedure VarLstInsertLst(var ALst: Variant; const ASrc: Variant; const AIdx: Integer);
Insert an array of items at the given index location.
procedure VarLstAppendLst(var ALst: Variant; const ASrc: Variant);
Append an array of items to the end of an array.
function VarLstConcat(const ALst1, ALst2: Variant): Variant;
Concat the items of two lists. Return the result.
function VarLstConcatLst(const ALst: Variant): Variant;
Concat the items of a list into one lst.
procedure VarLstUpperCase(var ALst: Variant);
Convert each item in a variant array to uppercase english.
procedure VarLstLowerCase(var ALst: Variant);
Convert each item in a variant array to lowercase english.

(back to top)
function VarNull or Null: Variant;
...
function VarUnassigned or Unassigned or Empty: Variant;
...
function VarType(const AVar: Variant): TVarType;
...
function VarTypeAsText(const AType: TVarType): String;
...
function VarIsNull(const AVar: Variant): Boolean;
...
function VarIsEmpty(const AVar: Variant): Boolean;
...
function VarIsClear(const AVar: Variant): Boolean;
...
function VarIsArray(const AVar: Variant): Boolean;
...
function VarIsStr(const AVar: Variant): Boolean;
...
function VarIsBool(const AVar: Variant): Boolean;
...
function VarIsOrdinal(const AVar: Variant): Boolean;
...
function VarIsFloat(const AVar: Variant): Boolean;
...
function VarIsNumeric(const AVar: Variant): Boolean;
...
function VarIsEqual(const A, B: Variant): Boolean;
...
function VarInRange(const AVar, AMin, AMax: Variant): Boolean;
...
function VarEnsureRange(const AVar, AMin, AMax: Variant): Variant;
...
function VarAnyToStr or VarToStr(const AVar: Variant): String;
...
function VarAnyToStrDef or VarToStrDef(const AVar: Variant; const ADef: String): String;
...
function VarToTagAttr(const AName: String; const AVar: Variant): String;
...

(back to top)
procedure VarAbortSearch(const AVar: Variant);
Raise a search abort exception.
function VarSameEng(const A, B: Variant): Boolean;
Return True if two variants have the same english value.
function VarIfThenElse(const AVar, ATrue, AFalse: Variant): Variant;
If AVar is True, then return ATrue else return AFalse.
function VarIfThen(const AVar, ATrue: Variant): Variant;
If AVar is True, then return ATrue else return Unassigned.
function VarAnyToEng or VarToEng(const AVar: Variant): String;
Convert a variant to a english string. (This is an extended VarToStr)
function VarFromEng(const AVar: Variant): Variant;
Convert an english string to a variant.
function VarAnyToXml(const AVar: Variant): String;
Encode a variant as html.
function VarToInnerText(const AValue: Variant): String;
Encode a variant as inner text.

(back to top)
function NS(const AWab, ASub: String): String;
Webable Namespace Functions
function D1(const AWab: String; const AX: Integer): String;
...
function D2(const AWab: String; const AX, AY: Integer): String;
...
function D3(const AWab: String; const AX, AY, AZ: Integer): String;
...

(back to top)
function WabGetProp or GetProp(const AWab, AProperty: Variant): Variant;
Get the property value of a webable. (Aborts if webable doesn't exist)
procedure WabSetProp or SetProp(const AWab, AProperty, AValue: Variant);
Set the property value of a webable.
function WabGetHash or GetHash(const AWab: Variant): Variant;
...
function WabGetValue or GetValue(const AWab: Variant): Variant;
Get the value of a process webable.
function WabGetIndexOfValue or GetIndexOfValue(const AWab: String; const AValue: Variant; const ALow, AHigh: Integer): Integer;
Get the index of a given value.
function WabGetIsHidden or GetIsHidden(const AWab: Variant): Boolean;
Get the hidden property of a webable.
function WabGetIsVisible or GetIsVisible(const AWab: Variant): Boolean;
Get the visible property of a webable.
function WabGetIsDisabled or GetIsDisabled(const AWab: Variant): Boolean;
Get the disabled property of a webable.
function WabGetType or GetType(const AWab: Variant): Variant;
...
function WabGetClass or GetClass(const AWab: Variant): Variant;
...
function WabGetOptions or GetOptions(const AWab: Variant): Variant;
Get the options property of a webable.
function WabGetSelected or GetSelected(const AWab: Variant): Variant;
Gets the selected option. Aborts if not avaliable.
function WabGetMarker or GetMarker(const AWab: Variant): Variant;
Get the marker property of a webable.
function WabGetString or GetString(const AWab: Variant): String;
Get the value of a process webable as a string. (Raises an exception on type conversion error)
function WabGetInteger or GetInteger(const AWab: Variant): Integer;
Get the value of a process webable as a integer. (Raises an exception on type conversion error)
function WabGetSingle or GetSingle(const AWab: Variant): Single;
Get the value of a process webable as a single. (Raises an exception on type conversion error)
function WabGetDouble or GetDouble(const AWab: Variant): Double;
Get the value of a process webable as a single. (Raises an exception on type conversion error)
function WabGetEnglish or GetEnglish(const AWab: Variant): String;
Get the value of a process webable as a string. (Raises an exception on type conversion error)
function WabGetBoolean or GetBoolean(const AWab: Variant): Boolean;
Get the value of a process webable as a boolean. (Raises an exception on type conversion error)
function WabGetHtml or GetHtml(const AWab: Variant): String;
Get the HTML property of a process webable. This also makes the variable value invalid.
function WabGetScaffold or GetScaffold(const AWab: Variant; const AIdx: Integer): String;
Get the scaffold value for a given webable. (Currently there are 7 scaffolds numbered 1-7)
procedure WabSetValue or SetValue(const AWab, AValue: Variant);
Set the value property of a process webable.
procedure WabSetValues or SetValues(const AWab, AValues: Variant);
Set an array of value properties.
procedure WabSetIsHidden or SetIsHidden(const AWab: Variant; const AValue: Boolean);
Changes the hidden property of a webable.
procedure WabSetIsVisible or SetIsVisible(const AWab: Variant; const AValue: Boolean);
Changes the visiblity of a webable. (This calls SetHidden with not(AValue));
procedure WabSetIsDisabled or SetIsDisabled(const AWab: Variant; const AValue: Boolean);
Changes the disable property of a webable.
procedure WabSetIsEnabled or SetIsEnabled(const AWab: Variant; const AValue: Boolean);
Changes the enabled property of a webable. (This calls SetIsDisabled with not(AValue))
procedure WabSetType or SetType(const AWab, AValue: Variant);
Set the type property of a process webable.
procedure WabSetClass or SetClass(const AWab, AValue: Variant);
Set the class property of a process webable.
procedure WabSetOptions or SetOptions(const AWab, AValue: Variant);
Set the options property of a process webable.
procedure WabSetSelected or SetSelected(const AWab, AOption: Variant);
Sets the selected option. Abort if option is not avaliable.
procedure WabSetScaffold or SetScaffold(const AWab: Variant; const AIdx: Integer; const AValue: String);
Set the scaffold value for a given webable. (Currently there are 7 scaffolds numbered 1-7)
procedure WabSendMessage(const AWab: Variant; const AValue: Variant);
...

(back to top)
procedure SetSelect(const AWab, AOptions: Variant);
Set up a webable as a select (combobox) input control.
procedure SetSelectBoolean(const AWab: Variant);
Set up a webable as a select (combobox) boolean selector.
procedure SetSelectHour(const AWab: Variant);
...
procedure SetSelectMinute(const AWab: Variant);
...
procedure SetSelectSecond(const AWab: Variant);
...
procedure SetSelectGender(const AWab: Variant);
Set up a webable as a select (combobox) gender selector.
procedure SetSelectLongMonthNames(const AWab: Variant);
...
procedure SetSelectLongDayNames(const AWab: Variant);
...
procedure SetSelectDayOfMonth(const AWab: Variant);
...
procedure SetSelectAmPm(const AWab: Variant);
...
procedure SetSelectYear(const AWab: Variant);
...
procedure SetSelectDate(const AWab: Variant);
...
procedure SetSelectTime(const AWab: Variant);
...
procedure SetButton(const AWab, ACaption: Variant);
Set up a process webable as a button, with the given inner HTML.
procedure SetButtonIcon(const AWab, ACaption, AIcon: Variant);
Set up a buttons with a caption and icon.
procedure SetAnchor(const AWab, ACaption: Variant);
Set up a process webable as a anchor, with the given inner HTML.
procedure SetAnchorIcon(const AWab, ACaption, AIcon: Variant);
Set up an anchor with a caption and icon.
function GetDate(const AWab: String): TDate;
...
procedure SetDate(const AWab: String; const ADate: TDate);
...
function GetTime(const AWab: String): TTime;
...
procedure SetTime(const AWab: String; const ATime: TTime);
...
Wascal Constants - [wascalconstants.pas]
(*pream: Friday, 15 August 2014 @ 13:57:05

Created by Geep Software

Library:  "dev" in "C:\wascal.net\dev\"
Source:   "tbwascal.pas" in "lib\toolbox\"

Modified: Friday, 15 August 2014 @ 12:12:26

Author:   Derek John Evans (derek.john.evans@hotmail.com)
Website:  http://www.wascal.net/

Copyright (C) 2013-2014 Derek John Evans

This is the code to my standard toolbox library.

Legal Notice
------------

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
USE OR OTHER DEALINGS IN THE SOFTWARE.

*)

{$IFDEF FPC}
unit TbWascal;

interface

{$ENDIF}

const

  // Standard Constants

  EmptyStr = '';
  LF = #10;
  CR = #13;
  EOL = CR + LF;

  CHAR0 = #0;
  BACKSPACE = #8;

  TAB = #9;
  CHAR32 = #32;

  OneKB = 1024;
  OneMB = OneKB * 1024;

  DOCTYPE_HTML_2_0 = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">';

  // Directory Constants

  dirSeparator = '/';
  dirCurrent = '.';
  dirParent = '..';
  dirRoot = '';
  dirMeta = '~';
  dirMyDocuments = dirMeta + 'mydocument';
  dirMyMusic = dirMeta + 'mymusic';
  dirMyPictures = dirMeta + 'mypictures';
  dirMyVideos = dirMeta + 'myvideos';
  dirSystem = dirMeta + 'systemroot';
  dirTemp = dirMeta + 'temp';
  dirHttp = dirMeta + 'http';
  dirUser = dirMeta + 'user';

  // Environment Variables

  envClassPath = 'classpath';
  envComSpec = 'comspec';
  envOs = 'os';
  envPath = 'path';
  envPathExt = 'pathext';
  envProcessorArchitecture = 'PROCESSOR_ARCHITECTURE';
  envProcessorIdentifier = 'PROCESSOR_IDENTIFIER';
  envProcessorLevel = 'PROCESSOR_LEVEL';
  envProcessorRevision = 'PROCESSOR_REVISION';
  envTemp = 'temp';
  envWinDir = 'windir';

  // Cgi Variables

  cgiAuthType = 'AUTH_TYPE';
  cgiContentLength = 'CONTENT_LENGTH';
  cgiContentType = 'CONTENT_TYPE';
  cgiGatewayInterface = 'GATEWAY_INTERFACE';
  cgiHttpHost = 'HTTP_HOST';
  cgiHttpReferer = 'HTTP_REFERER';
  cgiHttpUserAgent = 'HTTP_USER_AGENT';
  cgiPath = 'PATH';
  cgiPathInfo = 'PATH_INFO';
  cgiPathTranslated = 'PATH_TRANSLATED';
  cgiPhpSelf = 'PHP_SELF';
  cgiQueryString = 'QUERY_STRING';
  cgiRemoteAddr = 'REMOTE_ADDR';
  cgiRemoteHost = 'REMOTE_HOST';
  cgiRemoteIdent = 'REMOTE_IDENT';
  cgiRemoteUser = 'REMOTE_USER';
  cgiRequestMethod = 'REQUEST_METHOD';
  cgiRequestUri = 'REQUEST_URI';
  cgiScriptFilename = 'SCRIPT_FILENAME';
  cgiScriptName = 'SCRIPT_NAME';
  cgiServerName = 'SERVER_NAME';
  cgiServerPort = 'SERVER_PORT';
  cgiServerProtocol = 'SERVER_PROTOCOL';
  cgiServerSoftware = 'SERVER_SOFTWARE';

  // Http Response Codes

  HTTP_CONTINUE = 100;
  HTTP_SWITCHING_PROTOCOLS = 101;
  HTTP_PROCESSING = 102;
  HTTP_OK = 200;
  HTTP_CREATED = 201;
  HTTP_ACCEPTED = 202;
  HTTP_NON_AUTHORITATIVE = 203;
  HTTP_NO_CONTENT = 204;
  HTTP_RESET_CONTENT = 205;
  HTTP_PARTIAL_CONTENT = 206;
  HTTP_MULTI_STATUS = 207;
  HTTP_MULTIPLE_CHOICES = 300;
  HTTP_MOVED_PERMANENTLY = 301;
  HTTP_MOVED_TEMPORARILY = 302;
  HTTP_SEE_OTHER = 303;
  HTTP_NOT_MODIFIED = 304;
  HTTP_USE_PROXY = 305;
  HTTP_TEMPORARY_REDIRECT = 307;
  HTTP_BAD_REQUEST = 400;
  HTTP_UNAUTHORIZED = 401;
  HTTP_PAYMENT_REQUIRED = 402;
  HTTP_FORBIDDEN = 403;
  HTTP_NOT_FOUND = 404;
  HTTP_METHOD_NOT_ALLOWED = 405;
  HTTP_NOT_ACCEPTABLE = 406;
  HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
  HTTP_REQUEST_TIME_OUT = 408;
  HTTP_CONFLICT = 409;
  HTTP_GONE = 410;
  HTTP_LENGTH_REQUIRED = 411;
  HTTP_PRECONDITION_FAILED = 412;
  HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
  HTTP_REQUEST_URI_TOO_LARGE = 414;
  HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
  HTTP_RANGE_NOT_SATISFIABLE = 416;
  HTTP_EXPECTATION_FAILED = 417;
  HTTP_UNPROCESSABLE_ENTITY = 422;
  HTTP_LOCKED = 423;
  HTTP_FAILED_DEPENDENCY = 424;
  HTTP_UPGRADE_REQUIRED = 426;
  HTTP_INTERNAL_SERVER_ERROR = 500;
  HTTP_NOT_IMPLEMENTED = 501;
  HTTP_BAD_GATEWAY = 502;
  HTTP_SERVICE_UNAVAILABLE = 503;
  HTTP_GATEWAY_TIME_OUT = 504;
  HTTP_VERSION_NOT_SUPPORTED = 505;
  HTTP_VARIANT_ALSO_VARIES = 506;
  _INSUFFICIENT_STORAGE = 507;
  HTTP_NOT_EXTENDED = 510;

  fieldAccept = 'Accept';
  fieldAcceptCharset = 'Accept-Charset';
  fieldAcceptEncoding = 'Accept-Encoding';
  fieldAcceptLanguage = 'Accept-Language';
  fieldAuthorization = 'Authorization';
  fieldConnection = 'Connection';
  fieldContentEncoding = 'Content-Encoding';
  fieldContentLanguage = 'Content-Language';
  fieldContentLength = 'Content-Length';
  fieldContentType = 'Content-Type';
  fieldContentDisposition = 'Content-Disposition';
  fieldCookie = 'Cookie';
  fieldDate = 'Date';
  fieldExpires = 'Expires';
  fieldFrom = 'From';
  fieldIfModifiedSince = 'If-Modified-Since';
  fieldLastModified = 'Last-Modified';
  fieldLocation = 'Location';
  fieldPragma = 'Pragma';
  fieldReferer = 'Referer';
  fieldRetryAfter = 'Retry-After';
  fieldServer = 'Server';
  fieldSetCookie = 'Set-Cookie';
  fieldUserAgent = 'User-Agent';
  fieldWWWAuthenticate = 'WWW-Authenticate';

  // Encoding Types

  encMultipartFormData = 'multipart/form-data';

  // Common Ip's

  ipLocalHost = '127.0.0.1';

  // Common Hosts

  _hostCurrent = '.';
  _hostEmpty = '';
  hostGoogle = 'www.google.com';
  hostLocal = 'localhost';
  hostWascal = 'www.wascal.net';


  // Default Ports.

  portHttp = 80;
  portWascalServer = 8008;
  portMySql = 3306;
  portPostgreSql = 5432;

  // Default User Names

  userMySql = 'root';
  userPostgreSql = 'postgres';

  // Php Constants

  phpVersion = '5.1.2';
  phpBuildDate = 'Jan 11 2006 16:35:21';

  // Application Constants

  WascalName = 'Wascal';
  WascalCompany = 'Geep';
  WascalCopyright = 'Copyright (C) 2013-2014 Derek John Evans';

  WascalAppVersion = '1.0.3';

  WascalScriptName = WascalName + ' Script';
  WascalScriptVerName = WascalScriptName + ' (v' + WascalAppVersion + ')';

  WascalAppPublisher = WascalCompany + ' Software';
  WascalAppName = WascalScriptName + ' IDE';
  WascalAppVerName = WascalAppName + ' (v' + WascalAppVersion + ')';
  WascalAppPublisherUrl = 'http://' + hostWascal + dirSeparator;
  WascalAppSlogan = 'IDE for Wascal Scripts';
  WascalServerSoftware = WascalName + dirSeparator + WascalAppVersion;

  WascalSlogan = 'Application Development for Private Networks';
  WascalAuthor = 'Derek John Evans';
  WascalAuthorEmail = 'derek.john.evans@hotmail.com';

  // These are currently hardcoded, but will be adjustable in the future.

  DefaultProcessTimeOut = 30; // 30 Seconds
  DefaultSessionTimeOut = 30; // 30 Seconds

  dotAny = '.any';
  dotBak = '.bak';
  dotCfg = '.cfg';
  dotCgi = '.cgi';
  dotCss = '.css';
  dotCsv = '.csv';
  dotEng = '.eng';
  dotExe = '.exe';
  dotGif = '.gif';
  dotHtm = '.htm';
  dotHtml = '.html';
  dotImport = '.import';
  dotInc = '.inc';
  dotIni = '.ini';
  dotJpeg = '.jpeg';
  dotJpg = '.jpg';
  dotJs = '.js';
  dotP = '.p';
  dotPas = '.pas';
  dotPhp = '.php';
  dotPng = '.png';
  dotPp = '.pp';
  dotSql = '.sql';
  dotStr = '.str';
  dotTxt = '.txt';
  dotWascal = '.wascal';
  dotWip = '.wip';
  dotXml = '.xml';
  dotZip = '.zip';

  // DateTime Constants

  HoursPerDay = 24;
  MinsPerHour = 60;
  SecsPerMin = 60;
  MSecsPerSec = 1000;
  MinsPerDay = HoursPerDay * MinsPerHour;
  SecsPerDay = MinsPerDay * SecsPerMin;
  MSecsPerDay = SecsPerDay * MSecsPerSec;
  SelectYearLow = 1900;
  SelectYearHigh = 2020;

  // Http Protocol Types

  proFile = 'file';
  proHttp = 'http';
  proJavaScript = 'javascript';
  proWascal = 'wascal';

  // Wascal Component Names

  nameEventLog = 'EventLog';
  nameInfo = 'Info';
  nameLibrary = 'Library';
  nameLogging = 'Logging';
  nameMimeTable = 'MimeTable';
  nameProcess = 'Process';
  nameProcesses = 'Processes';
  nameRequest = 'Request';
  nameResponse = 'Response';
  nameWCOMRoot = 'WCOMRoot';
  nameServer = 'Server';
  nameSession = 'Session';
  nameSessions = 'Sessions';
  nameShared = 'Shared';
  nameVirtualPaths = 'VirtualPaths';
  nameWebables = 'Webables';
  nameWascal = 'Wascal';

  // Property Names (These must match the properties in the Wascal Server)

  pnAttrNames = 'AttrNames';
  pnAuthPassword = 'AuthPassword';
  pnAuthRealm = 'AuthRealm';
  pnAuthUsername = 'AuthUsername';
  pnBrowser = 'Browser';
  pnClass = 'Class_';
  pnCommand = 'Command';
  pnComment = 'Comment';
  pnContentEncoding = 'ContentEncoding';
  pnContentRaw = 'ContentRaw';
  pnContentText = 'ContentText';
  pnContentType = 'ContentType';
  pnDateTime = 'DateTime';
  pnDocument = 'Document';
  pnEcho = 'Echo';
  pnFilenamePhp = 'FilenamePHP';
  pnFormFiles = 'FormFiles';
  pnFormParams = 'FormParams';
  pnHash = 'Hash';
  pnHost = 'Host';
  pnImageGif = 'ImageGif';
  pnImageJpg = 'ImageJpg';
  pnImagePng = 'ImagePng';
  pnIp = 'Ip';
  pnIpPort = 'IpPort';
  pnIsDisabled = 'IsDisabled';
  pnIsHidden = 'IsHidden';
  pnIsHideItems = 'IsHideItems';
  pnIsInvalid = 'IsInvalid';
  pnItemClassNames = 'ItemClassNames';
  pnItemNames = 'ItemNames';
  pnLocalFile = 'LocalFile';
  pnLocation = 'Location';
  pnMarker = 'Marker';
  pnMessage = 'Message';
  pnName = 'Name';
  pnNodeCount = 'NodeCount';
  pnNodeNames = 'NodeNames';
  pnObject = 'Object';
  pnOptions = 'Options';
  pnPageTitle = 'PageTitle';
  pnParams = 'Params';
  pnPassword = 'Password';
  pnPath = 'Path';
  pnPaths = 'Paths';
  pnPort = 'Port';
  pnPropNames = 'PropNames';
  pnQueryParams = 'QueryParams';
  pnRawHttpCommand = 'RawHttpCommand';
  pnRecent = 'Recent';
  pnReferer = 'Referer';
  pnRemoteIp = 'RemoteIP';
  pnRequestCount = 'RequestCount';
  pnRequestId = 'RequestId';
  pnRequestTotal = 'RequestTotal';
  pnResponseNo = 'ResponseNo';
  pnScaffold = 'Scaffold';
  pnScaffold1 = 'Scaffold1';
  pnScaffold2 = 'Scaffold2';
  pnScaffold3 = 'Scaffold3';
  pnScaffold4 = 'Scaffold4';
  pnScaffold5 = 'Scaffold5';
  pnScaffold6 = 'Scaffold6';
  pnScaffold7 = 'Scaffold7';
  pnSessionId = 'SessionId';
  pnSyntax = 'Syntax';
  pnTimeout = 'Timeout';
  pnTimeStamp = 'TimeStamp';
  pnType = 'Type_';
  pnUrl = 'Url';
  pnUrlInternal = 'UrlInternal';
  pnUrlExternal = 'UrlExternal';
  pnUserAgent = 'UserAgent';
  pnUsername = 'Username';
  pnValue = 'Value';
  pnVersion = 'Version';

  // Common Mime Types

  mimeHtml = 'text/html';
  mimeText = 'text/plain';
  mimeCss = 'text/css';
  mimeJavaScript = 'text/javascript';

  // Wascal Webable Types

  wtAnchor = '.anchor';
  wtButton = '.button';
  wtCheckBox = '.checkbox';
  wtDate = '.date';
  wtDateTime = '.datetime';
  wtEdit = '.edit';
  wtFile = '.file';
  wtHidden = '.hidden';
  wtPassword = '.password';
  wtRadioGroup = '.radiogroup';
  wtSelect = '.select';
  wtSelectMultiple = '.selectmultiple';
  wtTextArea = '.textarea';
  wtTinyMCE = '.tinymce';
  wtValue = '.value';

  // Event Types

  etCommand = 'Command';
  etCompile = 'Compile';
  etCritical = 'Critical';
  etDebug = 'Debug';
  etError = 'Error';
  etException = 'Exception';
  etFormat = 'Format';
  etGeneral = 'General';
  etHint = 'Hint';

  // Url's to Server Resources

  urlPathCurrent = '';
  urlPathRoot = dirSeparator;
  urlPathParent = dirParent + dirSeparator;
  urlPathWCOMRoot = urlPathRoot + nameWCOMRoot + dirSeparator;

  urlPathVirtualHttp = urlPathRoot + dirHttp + dirSeparator;
  urlPathVirtualTemp = urlPathRoot + dirTemp + dirSeparator;
  urlPathVirtualUser = urlPathRoot + dirUser + dirSeparator;

  urlPathInc = urlPathRoot + urlPathParent + 'inc' + dirSeparator;
  urlPathPhp = urlPathVirtualHttp + 'php' + dirSeparator;
  urlPathCgi = urlPathVirtualHttp + 'cgi' + dirSeparator;
  urlPathSys = urlPathVirtualHttp + 'sys' + dirSeparator;
  urlPathImg = urlPathVirtualHttp + 'img' + dirSeparator;
  urlPathImg16 = urlPathVirtualHttp + '16' + dirSeparator;
  urlPathImg24 = urlPathVirtualHttp + '24' + dirSeparator;
  urlPathImg32 = urlPathVirtualHttp + '32' + dirSeparator; // Future use

  urlImportTypes = urlPathInc + 'wascaltypes.cfg';
  urlImportLibrary = urlPathInc + 'wascallibrary.ini';

  urlPhpInfo = urlPathPhp + 'info.php';

  urlDbsMySql = urlPathPhp + 'mysql.php';
  urlDbsPostGreSql = urlPathPhp + 'postgresql.php';

  urlBootStrap = urlPathSys + 'bootstrap.wascal';
  urlKeepAlive = urlPathSys + 'keepalive.wascal';
  urlIPhone = urlPathSys + 'iphone.wascal';
  urlWascalJs = urlPathVirtualHttp + 'wascal.js';

  urlPathTemp = proFile + '://' + dirTemp + dirSeparator;
  urlPathMyMusic = proFile + '://' + dirMyMusic + dirSeparator;
  urlPathMyDocuments = proFile + '://' + dirMyDocuments + dirSeparator;
  urlPathMyPictures = proFile + '://' + dirMyPictures + dirSeparator;
  urlPathMyVideos = proFile + '://' + dirMyVideos + dirSeparator;
  urlPathUserProfile = proFile + '://' + dirUser + dirSeparator;
  urlPathSystemRoot = proFile + '://' + dirSystem + dirSeparator;

  urlPathTinyMCE = urlPathVirtualHttp + 'tiny_mce' + dirSeparator;
  urlPathCalendar = urlPathVirtualHttp + 'jscalendar' + dirSeparator;

  // Url's to Server Nodes and Properties

  urlPathServer = proWascal + '://' + nameServer + dirSeparator;
  urlPathSession = proWascal + '://' + nameSession + dirSeparator;
  urlPathProcess = proWascal + '://' + nameProcess + dirSeparator;
  urlPathWebables = proWascal + '://' + nameWebables + dirSeparator;

  urlPathShared = urlPathServer + nameShared + dirSeparator;

  urlPathMimeTable = urlPathShared + nameMimeTable + dirSeparator;
  urlPathLogging = urlPathShared + nameLogging + dirSeparator;
  urlPathVirtualPaths = urlPathShared + nameVirtualPaths + dirSeparator;

  urlPathInfoRequest = urlPathSession + nameInfo + dirSeparator + nameRequest + dirSeparator;
  urlPathInfoResponse = urlPathSession + nameInfo + dirSeparator + nameResponse + dirSeparator;

  urlServerIp = urlPathServer + pnIp;
  urlServerPort = urlPathServer + pnPort;
  urlServerIpPort = urlPathServer + pnIpPort;
  urlServerPath = urlPathServer + pnPath;

  urlSessionName = urlPathSession + pnName;
  urlSessionTimeout = urlPathSession + pnTimeout;

  urlProcessName = urlPathProcess + pnName;
  urlProcessEcho = urlPathProcess + pnEcho;
  urlProcessTimeout = urlPathProcess + pnTimeout;
  urlProcessContentRaw = urlPathProcess + pnContentRaw;

  // Http Request Url's

  urlRequestAuthPassword = urlPathInfoRequest + pnAuthPassword;
  urlRequestAuthUsername = urlPathInfoRequest + pnAuthUsername;
  urlRequestCommand = urlPathInfoRequest + pnCommand;
  urlRequestContentEncoding = urlPathInfoRequest + pnContentEncoding;
  urlRequestContentType = urlPathInfoRequest + pnContentType;
  urlRequestDocument = urlPathInfoRequest + pnDocument;
  urlRequestFormFiles = urlPathInfoRequest + pnFormFiles;
  urlRequestFormParams = urlPathInfoRequest + pnFormParams;
  urlRequestHost = urlPathInfoRequest + pnHost;
  urlRequestParams = urlPathInfoRequest + pnParams;
  urlRequestPassword = urlPathInfoRequest + pnPassword;
  urlRequestQueryParams = urlPathInfoRequest + pnQueryParams;
  urlRequestRawHttpCommand = urlPathInfoRequest + pnRawHttpCommand;
  urlRequestReferer = urlPathInfoRequest + pnReferer;
  urlRequestRemoteIp = urlPathInfoRequest + pnRemoteIp;
  urlRequestUserAgent = urlPathInfoRequest + pnUserAgent;
  urlRequestUsername = urlPathInfoRequest + pnUsername;
  urlRequestVersion = urlPathInfoRequest + pnVersion;

  // Http Response Url's

  urlResponseAuthRealm = urlPathInfoResponse + pnAuthRealm;
  urlResponseLocation = urlPathInfoResponse + pnLocation;
  urlResponseResponseNo = urlPathInfoResponse + pnResponseNo;
  urlResponseContentType = urlPathInfoResponse + pnContentType;

  // Uri Field Indexes

  uriProtocol = 0;
  uriUsername = 1;
  uriPassword = 2;
  uriHost = 3;
  uriPort = 4;
  uriPath = 5;
  uriDocument = 6;
  uriParams = 7;
  uriBookmark = 8;

  // Xml Field Indexes

  xmlName = 0;
  xmlCfg = 1;
  xmlNodes = 2;
  xmlTextHead = 3;
  xmlTextFoot = 4;

  // System Webables (Wab's)

  wabWascal = 'Wascal' + dirSeparator;

  wabSecond = wabWascal + 'Second';
  wabMinute = wabWascal + 'Minute';
  wabHour = wabWascal + 'Hour';
  wabDay = wabWascal + 'Day';
  wabMonth = wabWascal + 'Month';
  wabYear = wabWascal + 'Year';
  wabAMPM = wabWascal + 'AMPM';

  // Standard Webable Buttons

  mbAbort = wabWascal + 'Abort';
  mbAll = wabWascal + 'All';
  mbCancel = wabWascal + 'Cancel';
  mbClose = wabWascal + 'Close';
  mbCreate = wabWascal + 'Create';
  mbDelete = wabWascal + 'Delete';
  mbEdit = wabWascal + 'Edit';
  mbHelp = wabWascal + 'Help';
  mbIgnore = wabWascal + 'Ignore';
  mbLogin = wabWascal + 'Login';
  mbNext = wabWascal + 'Next';
  mbNo = wabWascal + 'No';
  mbNoToAll = wabWascal + 'No to All';
  mbOK = wabWascal + 'OK';
  mbPing = wabWascal + 'Ping';
  mbPrev = wabWascal + 'Prev';
  mbRefresh = wabWascal + 'Refresh';
  mbReset = wabWascal + 'Reset';
  mbRestart = wabWascal + 'Restart';
  mbRetry = wabWascal + 'Retry';
  mbSave = wabWascal + 'Save';
  mbSearch = wabWascal + 'Search';
  mbSubmit = wabWascal + 'Submit';
  mbTerminate = wabWascal + 'Terminate';
  mbUpload = wabWascal + 'Upload';
  mbYes = wabWascal + 'Yes';
  mbYesToAll = wabWascal + 'Yes to All';

  // Html Tag Names (Must be upper case)

  tnAnchor = 'A';
  tnBody = 'BODY';
  tnButton = 'BUTTON';
  tnDiv = 'DIV';
  tnDocType = '!DOCTYPE';
  tnForm = 'FORM';
  tnHead = 'HEAD';
  tnHTML = 'HTML';
  tnImg = 'IMG';
  tnInfo = 'INFO';
  tnInput = 'INPUT';
  tnLabel = 'LABEL';
  tnLink = 'LINK';
  tnMeta = 'META';
  tnOption = 'OPTION';
  tnPHP = 'PHP'; // TODO: Should this be '?PHP' ?
  tnScript = 'SCRIPT';
  tnSelect = 'SELECT';
  tnSpan = 'SPAN';
  tnTable = 'TABLE';
  tnTD = 'TD';
  tnTextArea = 'TEXTAREA';
  tnTH = 'TH';
  tnTitle = 'TITLE';
  tnTR = 'TR';

  // Cfg/Html/Xml/Parameter Attribute Names (Must be lowercase)

  anAlign = 'align';
  anBorder = 'border';
  anBoundary = 'boundary';
  anCellPadding = 'cellpadding';
  anCellSpacing = 'cellspacing';
  anChecked = 'checked';
  anClass = 'class';
  anCommand = 'command';
  anConnect = 'connect';
  anContent = 'content';
  anDisabled = 'disabled';
  anEncType = 'enctype';
  anError = 'error';
  anFilename = 'filename';
  anHeight = 'height';
  anHost = 'host';
  anHRef = 'href';
  anId = 'id';
  anMethod = 'method';
  anMessage = 'message';
  anMultiple = 'multiple';
  anName = 'name';
  anOnClick = 'onclick';
  anPass = 'pass';
  anPort = 'port';
  anRel = 'rel';
  anSelected = 'selected';
  anSql = 'sql';
  anSrc = 'src';
  anStyle = 'style';
  anTarget = 'target';
  anType = 'type';
  anUrl = 'url';
  anUser = 'user';
  anVAlign = 'valign';
  anValue = 'value';
  anParams = 'params';
  anWidth = 'width';

  // Commands

  cmdCreate = 'create';
  cmdDestroy = 'destroy';

  // Html Input Types

  avitCheckbox = 'checkbox';
  avitEdit = 'edit';
  avitFile = 'file';
  avitHidden = 'hidden';
  avitPassword = 'password';
  avitRadio = 'radio';

  // Generic Attribute Values

  avAbsMiddle = 'absmiddle';
  avGet = 'get';
  avPost = 'post';
  avTop = 'top';

  // Default Attribute Values (Must be the same in wascal.js)

  avFormId = 'f';

  // Default Css Class Names (Always use these constants, incase the names change)

  cnControl = 'control';
  cnH1 = 'h1';
  cnH2 = 'h2';
  cnH3 = 'h3';
  cnH4 = 'h4';
  cnIcon = 'icon';
  cnInterface = 'interface';
  cnLabel = 'label';
  cnLN = 'ln';
  cnMessageBox = 'messagebox';
  cnMessageButtons = 'messagebuttons';
  cnModalDialog = 'ModalDialog';
  cnModalDialogClient = cnModalDialog + 'Client';
  cnModalDialogFooter = cnModalDialog + 'Footer';
  cnModalDialogHeader = cnModalDialog + 'Header';
  cnModalScreen = 'ModalScreen';
  cnPrompt = 'prompt';
  cnTable = 'table';
  cnTerminal = 'terminal';

  // Sql Types (These types are not final and therefore will change)

  sqlId = 'INTEGER';
  sqlFirstName = 'VARCHAR(20)';
  sqlLastName = 'VARCHAR(20)';
  sqlEmail = 'VARCHAR(40)';
  sqlPhone = 'VARCHAR(10)';
  sqlCity = 'VARCHAR(20)';
  sqlCountry = 'VARCHAR(20)';
  sqlState = 'VARCHAR(20)';

  guidNull = '{00000000-0000-0000-0000-000000000000}';
  guidBlankScreen = '{E2FE6435-1760-45D9-A566-2EF8B410208F}';

type

  TWascalMessage = (wmImageBrushColor, wmImageEllipse, wmImageFillRect, wmImageFontColor,
    wmImageFontHeight, wmImageFontSize, wmImageLine, wmImagePenColor, wmImageRoundRect,
    wmImageSaveToFile, wmImageSetSize, wmImageTextOut);
  TSearchType = (stForwards, stBackwards, stBinary);

{$IFDEF FPC}
implementation

{$ENDIF}

{$IFNDEF FPC}

{$INCLUDE $(wascalfilename)}

procedure SetupButton(const AName, ACaption, AIcon: Variant);
begin
  SetButtonIcon(AName, ACaption, urlPathImg16 + AIcon + dotGif);
end;

procedure SetupButtons;
begin
  SetType(mbPing, wtButton);

  SetupButton(mbCancel, 'Cancel', 'cancel');
  SetupButton(mbCreate, 'Create', 'paint');
  SetupButton(mbDelete, 'Delete', 'delete');
  SetupButton(mbEdit, 'Edit', 'editfile');
  SetupButton(mbLogin, 'Login', 'play_orange');
  SetupButton(mbNext, 'Next', 'next');
  SetupButton(mbNo, 'No', 'cross');
  SetupButton(mbOK, 'OK', 'smiley_face');
  SetupButton(mbPrev, 'Prev', 'previous');
  SetupButton(mbRefresh, 'Refresh', 'refresh');
  SetupButton(mbRestart, 'Restart', 'refresh');
  SetupButton(mbReset, 'Reset', 'redo_square');
  SetupButton(mbSave, 'Save', 'save');
  SetupButton(mbSearch, 'Search', 'search');
  SetupButton(mbSubmit, 'Submit', 'post');
  SetupButton(mbTerminate, 'Terminate', 'stop_orange');
  SetupButton(mbUpload, 'Upload', 'save_as');
  SetupButton(mbYes, 'Yes', 'tick');
end;

begin
  SetupButtons;
  repeat
    try
      Main;
    except
      WriteException;
    end;
    WriteAbout('Program has finished executing.');
    ReadLn(mbRestart);
    GetValue(mbRestart);
  until False;
end.
{$ENDIF}{$IFDEF FPC}end.
{$ENDIF}