HareScript language
The HareScript language is the core of our WebHare products. The conversion templates, web applications and the WebHare interface are all written in this language.
HareScript is a web scripting language optimized for quick and efficient data access and manipulation.
- Language structure
- Constants and initialisers
- Variable types
- Operators
- Control statements
- Appendix 1: Listing of reserved words
- Appendix 2: Operator precedence
Profiling, introspection and HareScript VM APIs
- RECORD FUNCTION DescribeCompiledLibrary(STRING resourcename)
Returns the functions defined in a library from the compiled version
- MACRO DisableFunctionProfile()
End function profile counting
- MACRO DisableMemoryProfile()
End function profile counting
- MACRO EnableFunctionProfile()
Start function profile counting
- MACRO EnableMemoryProfile()
Start function profile counting
- RECORD ARRAY FUNCTION GetAllUsedHarescriptLibraries()
Returns a list of all libraries referenced in this script
- RECORD ARRAY FUNCTION GetFunctionProfileData()
Get total profile statistics
- STRING FUNCTION GetFunctionPtrSignatureString(FUNCTION PTR v, STRING callname)
Describes the signature of a function ptr
- RECORD FUNCTION GetHarescriptLibraryInfo(STRING liburi)
Returns information about a library
- RECORD ARRAY FUNCTION GetHarescriptLoadedLibraries()
Returns a list of all libraries directly loaded by this script (for the initial load, or by functions as MakeFunctionPtr)
- STRING FUNCTION GetHareScriptMessageText(BOOLEAN iserror, INTEGER code, STRING param1, STRING param2)
Build the message text for an HareScript errror or warning
- STRING ARRAY FUNCTION GetObjectExtendNames(OBJECT obj)
Returns all the names an object has been created/extended with
- STRING FUNCTION GetObjectTypeName(OBJECT obj)
Returns the name of the object type of an object
- RECORD FUNCTION GetRawFunctionPtrSignature(FUNCTION PTR v)
Describes a function pointer
- BOOLEAN FUNCTION IsScriptOutOfDate()
Returns whether a loaded script file or loadlib has been changed since it was loaded
- MACRO ReportBlobReferences(STRING source, STRING command, RECORD options)
Sends a snapshot with memory usage to the profiling monitor
- MACRO ReportFunctionProfile(STRING source, STRING command, RECORD options)
Sends the current function profile data to the profiling monitor
- MACRO ReportHandleList(STRING source, STRING command, RECORD options)
Sends the current handle list to the profiling monitor
- MACRO ReportMemoryProfile(STRING source, STRING command, RECORD options)
Sends the current memory profile data to the profiling monitor
- MACRO ReportMemorySnapshot(STRING source, STRING command, RECORD options)
Sends a snapshot with memory usage to the profiling monitor
- MACRO ResetFunctionProfile()
Resets function profile
- MACRO ResetMemoryProfile()
Resets function profile
- MACRO SetupFunctionProfiling(STRING forsource, STRING forcommand)
Start function profiling in the current script, and report it automatically when the script ends