MOP Views for User Objects and DataWindows  Runtime menu modification for WM 5 platforms

Release Bulletin PocketBuilder™ 2.0.4

Support for bypassing the printer setup dialog box

PocketBuilder 2.0.4 adds an overloaded syntax for the PrintSetupPrinter PowerScript function. The overloaded syntax lets you program an application to bypass a printer setup dialog box when a user prints application data. As noted for other PocketBuilder print functions, you must install the FieldSoftware PrinterCE SDK to enable printing from a handheld device or emulator.

The overloaded PrintSetupPrinter syntax is:

PrintSetupPrinter ( Ipaddr, path, type, port, rate)

The function returns an integer with a value of 1 for success and -1 if an error occurs. The arguments for the overloaded syntax are described in the following table:

Argument

Description

Ipaddr

A string setting the IP address of a networked printer. If you use the path name instead of an IP address, you should enter an empty string for this argument.

path

A string for the network path of a host PC with a shared printer. If you use the IP address instead of a network path, you should enter an empty string for this argument.

type

A long value specifying the printer type. For example, you specify a a Hewlett-Packard PCL-compatible laser printer with a value of 5. Printer types and their corresponding values are specified in the FieldSoftware PrinterCE Developer’s Guide.

port

A long value specifying the printer port. Examples of values for different ports are: 0 for COM1, 9 for a shared printer on a host PC, 10 for a printer with its own IP address. Available ports and their corresponding values are specified in the FieldSoftware PrinterCE Developer’s Guide.

rate

A long value specifying the baud rate. You can select the following values for available baud rates:

  • 0 for 4800 baud or for networked printers

  • 1 for 9600 baud printers

  • 2 for 19200 baud printers

  • 3 for 34800 baud printers

  • 4 for 57600 baud printers

  • 5 for 115200 baud printers

Although you must enter string values for the first two arguments of PrintSetupPrinter, one of these arguments should take an empty string (“ ”) for a value. You can enter either an IP address for the printer you want to set up or a complete network path to the printer, but you should not enter values for both.

If you use the Ipaddr argument to specify the printer, you would typically use a value of 10 for the port argument. If you use the path argument to specify the printer, you would typically enter a value of 9 for the port argument.

The original syntax of PrintSetupPrinter does not have any arguments and is used in PowerBuilder applications to force display of the printer setup dialog box. Although you can call PrintSetupPrinter without any arguments in PocketBuilder, doing so does not change the current printer setup or display the printer setup dialog box.





Copyright © 2006. Sybase Inc. All rights reserved. Runtime menu modification for WM 5 platforms

View this release bulletin as PDF