The DOS VBPRINT Command


The VBPRINT command is placed inside CAPITAL for DOS .DOC (style sheet) forms. This command places an entry called a 'print job request' inside the Visual Builder print queue. Periodically Visual Builder checks the contents of the print queue for new entries. If they are found, control is transferred to Visual Builder which prints the form.

Visual Builder can also be set-up to automatically transfer control back to your DOS application once its printing task is completed. For more information on this topic see: The Print Job Manager.

The full syntax of the VBPRINT command is:

[VBPRINT=Formname, Spoolfile, Spool=path, Script=instructions]

Formname =

This is the name of the style sheet (STY) file to print. It must be located in the main \CAPITAL directory.

Spoolfile

This is optional but you may nominate a spool file if required. If not nominated the default spool file, which is S000000, is used. Each running copy of Visual Builder can have its own spool file. This would be useful if you wanted a specific running copy of Visual Builder to handle certain print tasks. For example, a copy of Visual Builder loaded on a very fast computer could be set-up to handle print tasks for the rest of the network. It could then be instructed to check for jobs contained in the spool file S0000005, for example. Any user who requested that jobs be directed to this spool file would free their own systems from having to print the form.

Note: This is a very advanced option that may interest a network administrator, computer consultant or programmer. Most users do not have to worry about specifying a spool file. You'll still be able to print all your forms without worrying about which spool file to use!

Spool=

You can specify the location of the CAPWIN.INI file which contains the default spool file for each local computer. You should specify either the spoolfile name or the spool= path, but not both in the same command.

On a Windows 95/98 system the path would normally be C:\Windows. For example:

[VBPRINT=myform,Spool=C:\Windows]

This is useful if you want the same form sent to different printers, depending on which computer is issuing the print request.

Script =

Special instructions written in CAPITAL Business Script can be specified after this entry. Extra values and parameters can be passed to the form being printed by using the optional Script= facility. This is a special purpose function reserved for programmers or advanced users.

The contents of the specified script are loaded into the global Visual Builder variable called CapData. The value of CapData can then be examined by the Visual Builder Form being executed. This is a practical way to pass data from CAPITAL Office to Visual Builder. See below:

[VBPRINT=MyForm, Script=smjobs->Job]

This command instructs CAPITAL to execute the form called MyForm. It will also run the script file smjobs->Job which references the service manager job number. The job number will be passed into the variable CapData. This could then be used, for example, as the Seek value of the form. (Passing the job number directly to Visual Builder avoids having to prompt the user to enter the job number each time the form is run.)

generate/mistake2.gifThe VBPRINT= command must be on the first line following the FORM= statement.



CAPITAL VISUAL BUILDER