xHarbour.com
  • Home
  • Shop
    • xHarbour Builder
    • Documentation
    • SQLRDD
    • Products >
      • Personal edition >
        • Upgrade to xHarbour Builder Professional
        • Upgrade to xHarbour Builder Enterprise
      • Professional >
        • Upgrade to xHarbour Builder Enterprise
      • Enterprise edition
  • Free demo
    • Download free demo
    • Showcase
  • Blog
  • Support
    • Docs >
      • xHarbour
      • Visual xHarbour
      • SQLRDD
    • VXH's current changelog
    • xHB Support News Group
    • VXH Support News Group
  • More on..
    • xHarbour
    • Support
    • Visual xHarbour
    • SQLRDD
    • XBScript
    • Visual xDebuger

XBScript

XBScript is a full featured scripting language engine that's compatible with any ActiveScript host like:
  • Windows Script Host (WSH)
  • Internet Explorer (IE)
  • Internet Information Server (IIS)
With XBScript, you can directly run .XBS source files from any command prompt or by clicking on a.XBS file from the Windows Explorer. XBScript Prompt is also a "Dot prompt"-alike utility where you can run external PRG code or administrate your xBase databases.

Multiple versions
XBScript comes in different personalities which are tied together very tightly.

1 .XBScript DLL as ActiveScript Host or WSG, IE or IIS
For this you need XBScript DLL edition. XBScript DLL is a full featured scripting language, compatible with any ActitveScript Host like WSH (WScript.exe and CScript.exe), Internet Explorer (IE) or Internet Information Server (IIS).

You may embed XBScript source in:
  • .xbs file, executed directly from console, or by clicking it from explorer
  • .html file to be executed in client browser, same as with JScript, VBScript etc. Simply use:
    <SCRIPT LANGUAGE="XBSCript">
  • .asp file, executed on a server, same as with JScript, VBScript etc. Simply use:
    <%@ Language=XBScript %>
  • Executed in any language supporting OLE, by means of:
    oSE := CreateObject("ScriptControl")
    oSE.AllowUI := .T.
    // Now execute some XBScript
    oSE.Language = "XBScript"
    oSE.ExecuteStatement("Alert(\"XBScript\")")
  • Executed by any Script Host compliant with the MS ActiveScript specifications.

2. A 100% Clipper compatible Pre-Processor with some extensions
For this you will need the XBScript-Prompt edition. Executing XBScript.exe followed by a source file name and the -P switch, will create <filename.pp$> which is the equivalent of the Clipper PPO file. A Clipper PPO of XBScript PP$ file is the result of the preprocessed PRG source file.

Syntax:
xbScript.exe filename[.ext] -P
Optional command line switches in this mode: 

• -CCH
Generate a .cch file (compiled command header).

• -D <id>
#define <id>.

• -D:E
Show tracing information in the expression Scanner.

• -D:M
Show tracing information into the Match Engine.

• -D:P
Show tracing information into the Output Generator.

• -FIX
Do not clone Clipper PreProcessor bugs.

• -l<path>
#include file search path(s) (';' separated). 

• -Q
Quiet.

• -U
Use command definitions set in (or none).


3. XBScript Prompt, which allows most of the Clipper syntax
For this you will need the XBScript-Prompt edition. In this mode you can execute a single line at a time by typing the line and pressing the [Enter] key.It does support IF [ELSE] [ELSEIF] ENDIF in DOT environment.

Executing XBScript with no source filename will start the DOT prompt mode.

Additionally you may type:
DO filename.prg [ENTER]
So that DOT will "run" the specified source file. This interpreter mode is subject to few limitations:
A - It does support LOCAL/STATIC/PRIVATE/PUBLIC, but:
• STATICs are actually implemented as publics.
• LOCALS have scoping of locals but are implemented as privates so you can't have a LOCAL and a PRIVATE with the same name.

B - Non-declared variables are auto-created on assignment in Harbour but NOT in Clipper (yet).
C - It does support definition and execution of prg-defined FUNCTIONs/PROCEDUREs.
D - It does support all control flow structures including: 

BEGIN SEQUENCE [BREAK] [RECOVER] END SEQUENCE
TRY [CATCH [<xCatcher>]] END.
FOR EACH <Enumerator> IN <Enumeration>
This will create rp_dot.pp$ compilation trace file.

xbScript is using pre-burned rules to support this functionality, unless a file named rp_dot.ch is present. If rp_dot.ch is present xbScript will load rp_dot.ch instead of using the pre-burned rules. If this file doesn't include all the needed rules, the functionality of the the Dot Prompt mode may be faulty.

4. Finally, XBScript is a limited Clipper/Harbour/xBase Interpreter
For this you will need the XBScript-Prompt edition. Subject to those same few limitations it can execute most of Harbour syntax. Executing XBScript-Prompt followed by a source file name and the -R switch will "RUN" that source (it will also create the rp_run.pp$ compilation trace file).

Syntax:
xbScript.exe filename[.ext] -R
In this mode these are the optional command line switches:

• -CCH
Generate a .cch file (compiled command header).

• -D <id>
#define <id>.

• -D:E
Show tracing information in the expression Scanner.

• -D:M
Show tracing information into the Match Engine.

• -D:P
Show tracing information into the Output Generator.

• -FIX
Do not clone Clipper PreProcessor bugs.

• -l<path>
#include file search path(s) (';' separated). 

• -Q
Quiet.

• -U
Use command definitions set in (or none).

So that DOT will "run" the specified source file. This interpreter mode is subject to few limitations:
A - It does support LOCAL/STATIC/PRIVATE/PUBLIC, but:
• STATICs are actually implemented as publics.
• LOCALS have scoping of locals but are implemented as privates so you can't have a LOCAL and a PRIVATE with the same name.

B - Non-declared variables are auto-created on assignment in Harbour but NOT in Clipper (yet).
C - It does support definition and execution of prg-defined FUNCTIONs/PROCEDUREs.
D - It does support all control flow structures including: 
BEGIN SEQUENCE [BREAK] [RECOVER] END SEQUENCE
TRY [CATCH [<xCatcher>]] END.
FOR EACH <Enumerator> IN <Enumeration

    
E - The compiled module is automatically using -n (No implicit startup procedure) if the script starts with a Procedure/Function definition.
F - Built-in OLE COM Client gateway is included when PP is compiled with xHarbour. 

XBScript is using pre-burned rules to support this functionality, unless a file named rp_run.ch is present. If rp_run.ch is present xbScript will load rp_run.ch instead of using the pre-burned rules. If this file doesn't include all the needed rules, the functionality of the the Interpreter mode may be faulty.

Thank you for your support.  You are awesome! 😀

100% Happiness Guarantee. 
If you are not 100% happy with any product purchased through xHarbour.com, request a refund through email within 30 days and we'll gladly refund you in full, no questions asked. Simple as that!

All content appearing on this website is proprietary, copyrighted and owned or licensed by xHarbour.com Inc. Any unauthorized use of trademarks or content from this website is strictly prohibited. All rights reserved.
®2016 xHarbour.com Inc.
  • Home
  • Shop
    • xHarbour Builder
    • Documentation
    • SQLRDD
    • Products >
      • Personal edition >
        • Upgrade to xHarbour Builder Professional
        • Upgrade to xHarbour Builder Enterprise
      • Professional >
        • Upgrade to xHarbour Builder Enterprise
      • Enterprise edition
  • Free demo
    • Download free demo
    • Showcase
  • Blog
  • Support
    • Docs >
      • xHarbour
      • Visual xHarbour
      • SQLRDD
    • VXH's current changelog
    • xHB Support News Group
    • VXH Support News Group
  • More on..
    • xHarbour
    • Support
    • Visual xHarbour
    • SQLRDD
    • XBScript
    • Visual xDebuger