Client Methods
Version 3.2


General Components Global Objects
Introduction
Selecting a Method
Method Return Values
Method Parameters
Documentation Format
 
 
Containers
Generic Container
Frame
Panel
Tabpanel
Tab
Cardpanel
Card
Generic Component
Button
Checkbox
Combobox
Hyperlink
Image
Label
Menubar
Menu
Menu Item
Passwordfield
Progressbar
Table
Textarea
Textfield
Textpane
Tree
System Methods
     General
     Fonts
     Timer
     Message Boxes
     Managing Apps
Host Call Methods
HTTP Methods
RPC Methods
FTP Methods
Preferences Methods
Barcode Scanner Methods
Serial Port Methods
Infrared (IR) Port Methods
File System Methods
Signature Capture Methods
Video Capture Methods




Introduction

This document lists the most common methods that are used in functions in the Jargon Writer Script Editor. There are many methods that can be applied to individual containers and components, including:

In addition, several powerful  system methods can be applied to the global "sys" object: For running procedures on a remote server, a set of Remote Procedure Call (rpc) methods are provided: For obtaining any kind of response from a remote server, a set of general-purpose HTTP methods are provided:
  • assigning the URL for the HTTP request
  • assigning name/value pairs for any desired input parameters
  • assign the name of a function to be run when the response is received from the remote server
  • sending the request URL and POST name/value pair data to the remote server
  • accessing the response data (when received) and its size in bytes

  • Selecting a Method
    Methods can be selected from a listbox in the Script Editor for each type of component. When a container or component is selected in the target tree on the left side of the Script Editor, an alphabetical list of its available methods will be shown in the "Target method" listbox below the tree. Each method's name, parameters and return value are listed.

    The available methods are defined in a file specified by the "MethodList" value in the Jargon Writer system\preferences.ini file. To shut off the feature, comment out this entry by placing a "#" character at the start of the line containing "MethodList=". The default entry is:

       MethodList=./system/jsimethods.xml

    Method Return Values
    If the method returns a value, the object type will be listed in the "Return type" column. An entry of "void" means that no value is returned. Common return types are "string" (also called "java.lang.String"), "int" and "boolean". Methods with return values are used in rpc methods to populate host parameters with the current contents of objects such as textfields, and may also be used as nested methods to populate the parameters of other client methods (these can be nested multiple levels if needed).

    Method Parameters
    Many methods have one or more parameters that are one of the basic object types: "string" ("java.lang.String"), "int" or "boolean". In general, methods which require parameters that are more complex objects cannot be used unless there is another method which can be specified as a subtask to populate the parameter with that kind of object value.

    User Tip: Note that some string parameters specify an "object name" that names a container or component object to which the method will be applied, such as the name of a tab within a tab panel. These names are case-sensitive, meaning that upper and lower case must exactly match the name used in Jargon Writer for this object. This means that 'tabone' and 'TabOne' cannot be used interchangeably to reference the same client object. This rule is different than the syntax used in many other languages, and can be the cause of numerous errors if not carefully followed.


    Documentation Format
    The following format is used for the methods described in this document:

  • Method: a method name, followed by an ordered list of any required parameters (in parentheses)
  • Return: type of value returned by the method ("void" means none)
  • Param0: description of the first parameter (if any)
  • Param1: description of the second parameter (etc.)


  • Container Methods
    These methods are used with various container objects (frames, panels, cardpanels, tabpanels). There are both generic container methods that can be used with any container type, and other methods that are specific to a particular container type.
     

    Generic Container
    These methods can be used on any container object (frame, panel, cardpanel, tabpanel).

    View or Hide a Container and its Contents
    This method makes a container visible or invisible (hidden).
    Frame
    Get Component Name That Has Focus
    This method gets the name of the component that currently has focus in a frame. Repaint a Frame
    This method forces a repaint of a frame's contents. Does not redraw table contents, use table.Repaint() to do that. Display a Status Message
    This method displays a one-line message in a frame's status panel (at the bottom of the frame). Change a Frame Title
    This method dynamically changes the title displayed in a frame's title bar.


    Panel

    Get Handle to Panel
    This method gets a handle to this panel. (Used with "video" global object methods).
    Get Pixel Height of Panel
    This method gets the pixel height of this panel. (Used with "video" global object methods).
    Get Pixel Width of Panel
    This method gets the pixel width of this panel. (Used with "video" global object methods). Set Tooltip Text
    This method sets the tooltip text for a panel.


    Tab Panel (not supported on PalmOS)


    Get Number of Selected Tab in a Tab Panel
    This method gets the number of the tab that is currently displayed within the tab panel. Tabs are numbered from zero (0) to (n-1) for a tabpanel with (n) tabs. Since users can bring up different tabs by clicking on them, this provides a way to see which tab is currently visible ("on top").


    Get Name of Selected Tab in a Tab Panel
    This method gets the Object Name of the tab that is currently displayed within the tab panel. Since users can bring up different tabs by clicking on them, this provides a way to see which tab is currently visible ("on top").

    Repaint
    This method forces a repaint of the tabpanel so that new values will be made visible immediately. Display a Tab in a Tab Panel by Name
    This method changes the tab that is currently displayed within the tab panel by specifying a tab name. Display a Tab in a Tab Panel by Number
    This method changes the tab that is currently displayed within the tab panel by specifying a tab number (starting from zero).


    Tab

    Set Tooltip Text
    This method sets the tooltip text for a tab in a tabpanel.


    Card Panel (not supported on PalmOS)


    Get Number of Current Card in a Card Panel
    This method gets the number of the card that is currently displayed within a card panel. Cards are numbered from zero (0) to (n-1) for a cardpanel with (n) cards. This provides a way to determine which card is currently visible ("on top").


    Get Name of Current Card in a Card Panel
    This method gets the Object Name of the card that is currently displayed within the card panel. This provides a way to determine which card is currently visible ("on top").

    Repaint
    This method forces a repaint of the cardpanel so that new values will be made visible immediately. Display a Card in a Card Panel by Name
    This method changes the card that is currently displayed within the card panel by specifying a card name. Display a Card in a Card Panel by Number
    This method changes the card that is currently displayed within the card panel by specifying a card number (starting from zero).


    Card

    Set Tooltip Text
    This method sets the tooltip text for a card in a cardpanel.


    Component Methods
    These methods are used with various component objects (objects that are not containers). There are both generic component methods that can be used with any component type, and other methods that are specific to a particular component type.
     

    Generic Component
    These methods can be used on any component object.

    View or Hide a Component and its Contents
    This method makes a component visible or hidden (hidden). Set Tooltip Text of a Component
    This method sets the tooltip text for a specified component. May be used on all components except label, frame and menubar/menu/menuitem.

    Button

    Enable or Disable a Button
    This method enables or disables a button. Get Button Caption (as Character String)
    This method gets the character value of the current caption (label) of a button as a "string" data type. Set Button Caption
    This method assigns a caption (label) to a button. The new value will not be displayed until the button's frame is redrawn using the "frame.SetVisible(true)" method.

    Checkbox

    Select or Unselect a Checkbox
    These methods are used to select (check) or unselect (clear) a checkbox. Get Current Selected Status of a Checkbox
    This method gets the current state of a checkbox (selected or unselected).
    Combobox
    Get Selected Index
    This method gets the index (starting at zero) of the currently selected item in a combo box. Get Selected Value
    Either of these methods can be used to get the string value of the currently selected item in a combo box. Insert or Append List Item(s)
    This method adds one or more choices to the selection list. New list items can be appended to the end (bottom) of the list of choices or inserted at a specified location in the list. Remove All List Items
    This method removes all choices from the selection list (clear the combobox). Select List Item by Number
    This method sets the currently selected item to the n'th choice in the selection list. The selections are numbered starting with zero, so valid parameter values are 0,1,2,3 ... (n-1) for a list with n selections. Select List Item by Value
    This method sets the currently selected item by specifying the value of one of the choices.
    Hyperlink
    Display Text
    This method assigns a display value to a hyperlink. The new value will be immediately displayed if the hyperlink is currently visible. Note that the SetText method will not resize the component if the specified string is longer than the initial size of the component. Change User Data
    This method assigns a user data value to a hyperlink. Get Current Value (as Character String)
    This method gets the character value of the current contents of a hyperlink's display value as a "string" data type. Get Current User Data (as Character String)
    This method gets the character value of the current contents of a hyperlink's user data as a "string" data type.
    Image
    Assign an Image Value
    This method displays an image by assigning a binary data value to an image component. The image may be specified as resizable or it can be truncated as need to fit into the declared image component size.
    NOTE: Images are NOT supported in Jargon Reader for Palm OS. All other Jargon Reader versions for Windows and PocketPC devices support images, including all standard GIF and JPG formats. Remove an Image Value
    This method clears an image by displaying background color throughout the image component area.
    Label
    Set Label Caption
    This method assigns a caption to a label. The new value will not be displayed until the label's frame is redrawn using the "frame.SetVisible(true)" method.

    Menubar

    No Menubar methods are currently available.

    Menu

    No Menu methods are currently available.

    Menu Item

    No Menu Item methods are currently available.

    Passwordfield

    Display Text
    This method assigns a value to a passwordfield. The new value will be immediately displayed if the passwordfield is currently visible. However, all characters in the data value are replaced with asterisks ("****") in the displayed value, for security purposes. Get Current Value (as Character String)
    This method gets the character value of the current contents of a passwordfield as a "string" data type. Set Focus on Passwordfield
    This method sets "focus" on a passwordfield, so that entered data will go into the specified passwordfield. Set Font ID
    This method assigns a font ID for display of the component value.

    Progressbar

    Increment Value
    This method increments the current number of displayed increments in the progress bar by one. Each increment in the progress bar displays a small solid colored rectangular shape. Increments beyond the current maximum have no effect. Set Maximum
    This method assigns the number of increments in the progress bar. Each increment in the progress bar displays a small solid colored rectangular shape. Set Value
    This method assigns the current number of displayed increments in the progress bar. Each increment in the progress bar displays a small solid colored rectangular shape. Assign zero (0) to display an empty progress bar. Display the maximum value to display a "full" progress bar.

    Table

    Assign a Column Label
    This method assigns or changes the contents of one column label in a table. Column numbers are specified starting with zero (not one). Assign a Value to One Table Cell
    This method assigns or changes the contents of one cell in a table. Both the row and column numbers must be specified, and both are numbered starting with zero (not one). Assign Values to a Row of Table Cells
    This method assigns or changes the contents of all the cells in one row of a table. The row number must be specified, and is numbered starting with zero (not one). Get Data from One Table Cell
    This method gets the current value in one table cell (a specified row and column). Get Selected Column Number
    This method gets an integer that is the column number of the most recently selected column in the table (note that the leftmost column in a table is column zero). Get Selected Row Number
    This method gets an integer that is the row number of the most recently selected row in the table (note that the top row in a table is row zero). Set Selected Row Number
    This method selects a row in the table. Clear All Row Selections
    This method deselects all selected table rows and clear the row selection highlighting. Remove All Rows
    This method removes all rows from a table and clears the row selection highlighting. It also repositions the visible cells so that the first visible column of row 0 is in the upper left-hand corner. Position Row within Viewable Area of Table
    This method scrolls the table up or down so that the specified row is at the top, center or bottom of the viewable area of the table. Repaint
    This method forces a repaint of the table so that new values will be made visible immediately. Set Cell Font ID
    This method assigns a font ID for display of a cell value. This method can be used with text or hyperlink cell values. Set Cell Editor Type
    This method assigns an editor type to one table cell. The editor type can be a textfield (type 0 or 1) or a combobox (type 2). This method is normally used only for editable table columns. Assign Values to a Combobox Table Cell
    This method assigns choices to one table cell that has an editor type of combobox (2). The choices are delimited by a specified delimiter (which allows commas in the choice values if the delimiter is not a comma, for instance).
    Textarea
    Display Text
    This method assigns a value to a textarea. The new value will be immediately displayed if the textarea is currently visible. Insert Text
    This method inserts the specified text at (before) the character at the specified byte offset. The textarea is not repositioned (the current top line stays at the top). If nByteOffset is negative, it prepends the text to the textarea value. If nByteOffset is greater than the length of the textarea contents, it appends the text to the textarea value. Append Text
    This method appends a string value to an existing value in a textarea. The new value will be immediately displayed if the textarea is currently visible. Get Current Value
    This method gets the string value of the current contents of a textarea. Set Focus on Textarea
    This method sets "focus" on a textarea, so that entered data will go into the specified textarea. Set Font ID
    This method assigns a font ID for display of the component value. Get Window Position
    This method gets the byte offset of the first character in the currently displayed top line of the textarea window. Set Window Position
    This method positions the text line containing the character at the specified nByteOffset to the specified windowLocation in the textarea window: 0=top 1=middle 2=bottom. Get Cursor Position
    This method gets the byte offset of the current location of the insertion cursor. If there is no current location, returns -1. Set Cursor Position
    This method sets the current location of the insertion cursor to the left of the character at the specified byte offset. If nByteOffset is negative, it sets the location at offset zero. If nByteOffset is greater than length of the textarea contents, it sets the location after the last character in the textarea. Get Selection Position
    This method gets the byte offset of the first character of the currently selected string within the textarea. If no string is selected, returns the position of the insertion cursor if any, otherwise -1. Get Selected Text
    This method gets the currently selected string from the textarea. If no characters are selected, returns an empty string (''). Set Selected Text
    This method selects (and highlights) the number of characters specified by nLength, starting with the character at nByteOffset. If nLength is zero, the insertion cursor will be positioned at the specified offset but no characters will be selected. If nByteOffset is negative or greater than the length of the textarea contents, the insertion cursor may be repositioned but no characters will be selected. Replace Selected Text
    This method replaces the currently selected string in the textarea with the specified new text. If no string is selected, this method behaves like InsertText if the insertion cursor has a current position. The textarea is not repositioned (the current top line stays at the top).
    Textfield
    Display Text
    This method assigns a value to a textfield. The new value will be immediately displayed if the textfield is currently visible. Insert Text
    This method inserts the specified text at (before) the character at the specified byte offset. If nByteOffset is negative, it prepends the text to the textfield value. If nByteOffset is greater than the length of the textfield contents, it appends the text to the textfield value. Get Current Value (as Character String)
    This method gets the character value of the current contents of a textfield as a "string" data type. Set Focus on Textfield
    This method sets "focus" on a textfield, so that entered data will go into the specified textfield. Set Font ID
    This method assigns a font ID for display of the component value. Get Cursor Position
    This method gets the byte offset of the current location of the insertion cursor. If there is no current location, returns -1. Set Cursor Position
    This method sets the current location of the insertion cursor to the left of the character at the specified byte offset. If nByteOffset is negative, it sets the location at offset zero. If nByteOffset is greater than length of the textfield contents, it sets the location after the last character in the textfield. Get Selection Position
    This method gets the byte offset of the first character of the currently selected string within the textfield. If no string is selected, returns the position of the insertion cursor if any, otherwise -1. Get Selected Text
    This method gets the currently selected string from the textfield. If no characters are selected, returns an empty string (''). Set Selected Text
    This method selects (and highlights) the number of characters specified by nLength, starting with the character at nByteOffset. If nLength is zero, the insertion cursor will be positioned at the specified offset but no characters will be selected. If nByteOffset is negative or greater than the length of the textfield contents, the insertion cursor may be repositioned but no characters will be selected. Replace Selected Text
    This method replaces the currently selected string in the textfield with the specified new text. If no string is selected, this method behaves like InsertText if the insertion cursor has a current position.
    Textpane
    Display Text
    This method assigns a value to a textpane. The new value will be immediately displayed if the textpane is currently visible. Append Text
    This method appends a string value to an existing value in a textpane. The new value will be immediately displayed if the textpane is currently visible. Get Current Value
    This method gets the string value of the current contents of a textpane. Set Font ID
    This method assigns a font ID for display of the component value.


    Tree

    Note: available on Windows platforms only.

    Collapse a Node
    This method collapses a parent node that is currently expanded to show its child nodes, so that the child nodes are no longer displayed. After being collapsed, this node will show a "+" sign to its left, indicating that it contains one or more child nodes that are not currently visible. Expand a Node
    This method expands a collapsed parent node so that its immediate child nodes will be displayed. Note that the expansion is not recursive, meaning that this method does not expand "grandchild" nodes (nodes under any child node that has its own child nodes). Get Image Index of a Node
    This method gets the integer value that specifies the image filename for a specified node. Get Text of a Node
    This method gets the string value of the displayed text for a specified node. Get Tooltip of a Node
    This method gets the string value of the tooltip for a specified node. Get User Data of a Node
    This method gets the string value of the "user data" attribute for a specified node. Get Name of Currently Selected Node
    This method gets the string value that is the internal name of the currently selected node. Get User Data of Currently Selected Node
    This method gets the string value of the "user data" attribute of the currently selected node. Insert a Node
    This method adds a node to a tree, either under the tree "root" node itself, or under any other node in the tree. Remove Child Nodes of a Node
    This method removes all child nodes under the specified parent node. This removal is recursive, so "grandchild" nodes and lower levels of nodes will also be removed. Remove a Node
    This method removes the specified node. This removal is recursive, so any child nodes and their children will also be removed. Repaint a Tree
    This method repaints the target tree. If the text or image index of any nodes have been changed, this will redisplay the new text and images. Enable or Disable a Tree
    This method enables or disables a tree. Set Image Index of a Node
    This method sets the integer value that specifies the image filename for a specified node. Set Text of a Node
    This method sets the displayed text for a specified node. Set Tooltip of a Node
    This method sets the tooltip for a specified node. Set User Data of a Node
    This method sets the "user data" attribute for a specified node. Select a Node
    This method selects the specified node. This will cause the specified node entry in the tree to become highlighted and will also fire the TreeSelection event.



    Methods for Global Objects
    These methods are used with various "global" objects that are not part of the visible user interface. These non-visual objects and methods provide system functions, interfaces to ports, peripherals and file systems, host request and response processing, and startup preferences.
     


    System Methods

    These methods are all used with the "sys" object, which is a system-wide (global) object that is not associated with any one application or component.


    System Methods: General
    System Exit (end session)
    This method does a "system exit", which ends the current session and returns to the Jargon Reader initial ApplicationMenu program. It can be the last statement in a function that is associated with a "Logout" or "Exit" button, for example. Get Event Source Name
    This method gets the name of the component on which the most recent event occurred. Get Product Name
    This method gets the name of the specific Jargon Reader engine in which the application is currently being run. Values are in the form "ReaderXXX", where XXX is an acronym for the platform, as documented in the product release notes. For example, "ReaderPDA" is the Jargon PDA Emulator, "ReaderPPC" is the Pocket PC version without Oracle DB support, "ReaderPPO" is the Pocket PC version with Oracle DB support, etc. This method may be used to determine whether device-specific logic can be (or should be) run. Get Open File Name
    This method gets a file name to be opened, using a standard Windows "Open File" dialog box. The default file types are "XML" and "All", however the "Files of Type" list choices can be overriden by an optional parameter. (ReaderWIN only). Get Save File Name
    This method gets a file name to be saved, using a standard Windows "Save As" dialog box. The default file types are "XML" and "All", however the "files of type" list choices can be overriden by an optional parameter. (ReaderWIN only). Process CIO Instructions
    This method executes one or more CIO (Component Instruction Object) instructions received from a host procedure. Show Web Document
    (Note: implemented on Windows PCs only, using ReaderPDA.exe or ReaderWin.exe).
    This method displays a web document such as an HTML web page, a PDF document file, an image file, or any other valid browser object with a specified URL, in a web browser on a client PC. The browser is invoked on the client PC using the default web browser defined in the Windows registry. A new browser window will be opened each time this method is executed.

    System Methods: Fonts
    Create Font
    This method creates a handle to a "font object" with specified font face, point size, and optional bold and underline styles. The last two parameters are optional and may not work for all fonts. The handle returned from CreateFont() is good for the entire Reader session, and is used by the SetFontID method of various text components such as textfields and textareas.
    System Methods: Timer
    Set Timer Callback
    This method assigns a function to be executed in a specified app after a timer has been started and has run for a specified number of milliseconds. After each execution, the timer is reset and this process will repeat until the timer is stopped. Note that during the execution of the specified function, any user interface events will be blocked, so you should not set the timer interval to a value that is too brief or the user may not be able to click a button that runs a function to stop it (unless the timer will eventually be stopped automatically by the program). Start Timer
    This method starts the timer. The SetTimerProc method should be run first to specify a callback procedure before using this method. Stop Timer
    This method stops the timer.
    System Methods: Message Boxes
    Message Box
    This method displays an informational message to the user, in a modal dialog box with an OK button. Warning Box
    This method displays an error or warning message to the user, in a modal dialog box with an OK button. Similar to "message box" except that the warning box uses a different icon image. Dialog Box
    This method displays a message to the user in a modal dialog box with a choice of certain button combinations. It returns a string containing the label of the selected button (e.g. "OK", "Cancel" etc.).
    System Methods: Managing Apps
    Get Installed App List
    This method gets a comma-separated list of the names of the currently installed (cached) xml application files. Load App Configuration
    This method installs (caches) the configuration (".ini" file) data for an xml application file. If successful, it returns the value of the AppName parameter. Open App
    This method opens a cached client xml application file into working memory, and optionally runs its initial function.

    If a configuration (".ini" file) has been previously received and loaded with the "sys.LoadAppConfig" method, then its preferences are used for the app, otherwise the new app will "inherit" the AppRootURL, HostURL and Script values of the invoking app, and only the AppName will be different.

    If not already cached, the xml file to be opened will first be downloaded from the AppRootDir (as specified above) and cached on the local device.

    An optional second boolean parameter controls whether the init tasklist of the new app will be run. The default is 'true' to run it. Since the script engine won't recognize the newly opened app until the process that opened it ends, a new callback method "sys.SetOpenCallback" has been implemented to return control to a specified app/function after an app has been opened. This callback can be used whether or not the app's initial function is also run, and if so the callback function will be run after the opened app's initial function completes.

    SetOpenCallback
    This method assigns a function to be executed in a specified app after an app has been opened. If the opened app runs its init function, this callback function will be run after the init function is completed. The specified function may be in the app being opened, the calling app, or some third app. If the app or function name is an empty string, then the execution thread ends and no other action is taken until the user interacts with whatever frame is visible.

    After the specified callback function has run following the opening of an app, both the appName and functionName parameters are cleared, so they will not be used on the next app open unless this method is run again. You may also explicitly clear the callback parameters at any time with sys.SetOpenCallback('',''), however this is usually not necessary.

    Update App
    This method updates the specified xml application file by replacing the current cached copy with a new copy from the server. A new copy of the xml file will be downloaded from the specified AppRootDir, then cached and opened. Close App
    This method closes the specified xml application file by removing it from working memory. It will still remain in the local device cache, but its objects and methods will no longer be accessible from script functions. If a frame from this app is rendered it will be closed, and if it is the only currently visible frame, this method will also call the init() function of the Jargon Reader ApplicationMenu startup routine. This method may be used to conserve memory on resource-limited platforms such as older PalmOS-based devices. Delete App
    This method deletes the specified xml application file from the local cache. Test If App Is Configured
    This method tests whether the "configuration preferences" for the specified xml client application file have been installed. These preferences can be installed by loading an ".ini" file or by directly opening the app and thereby inheriting the calling app's preferences. The minimum set of required configuration preferences are "AppRootDir", "AppName", "HostURL" and "Script". Test If App Is Cached
    This method tests whether the specified xml client application file has been cached (installed) on the local device. An app can be cached by the OpenApp or UpdateApp methods. Test If App Is Open
    This method tests whether the specified xml client application file has been opened (loaded from cache into working memory) during the current execution session. An app can be opened by the OpenApp or UpdateApp methods. If an app is open, its objects and methods can be accessed from script functions, but it may or may not have any visible frames.
    Host Call Methods

    There are three global system objects and related methods that can be used to send a request to a remote server and to process the data that it sends back to the client in response.

    HTTP Methods
    These methods are used with the global "http" (HyperText Transmission Protocol) object to prepare and send a URL and optional POST data to a remote server. The URL may specify a host procedure, a text file, an image file, or any other valid URL object that the remote web server can handle.
    SetURL
    This method creates the URL string that will be used to access a remote server resource. It includes the "http://<host>" string, while the rest of the string is application-specific. Specific formatting of the URL must conform to the host resource being used. SetNotifyProc
    This method assigns a callback function to be executed when the server response has been completely received. Both an appname and a function name that exists in that app must be specified, or both can be set to empty strings.

    Once assigned, these values remain in effect for every http request until they are changed or cleared. If no app/function names are assigned via this method in the current app before an http.SendRequest executes, then any values that may have been set in a previous app will be used. In particular, the default ApplicationMenu.xml startup menu app that is hardwired into Jargon Reader does the following when loading an app ".ini" file:

    The calback values can be reset by assigning empty strings, e.g.

    If the values are empty (blank), then no callback is done, and the response data will simply sit in the response buffer and no other action is taken. This would allow, for example, the http.GetResponseData() method to be used at some later time within the script without doing so immediately upon receipt of the data.

    Note: to emulate "rpc" functionality, simply use SetNotifyProc to run a function that contains the single statement:
    "sys.ProcessInstructions(http.GetResponseData())".

    AddParam
    This method assigns a name/value pair to be used as an input parameter for the http request. The "name=value" data pair will be appended to the URL string assigned by SetURL using standard CGI/POST syntax. SendRequest
    This method sends the URL request to the remote server. SendRequest (for SSL)
    This method sends the URL request to the remote server and specify whether SSL encryption is to be used or not. GetSuccess
    This method gets the success or failure status of the response from the remote server. Note that this should be tested before using the GetResponseSize/Data methods below, as the buffer may contain an error message of non-zero length, so a response length greater than zero does not ensure that a valid response was received. SetShowErrors
    This method controls whether Jargon Reader will automatically display system messages for any errors in http requests/responses. If this method is not used, the default is 'true' (which is consistent with previous versions). If SetShowErrors is set to false, the script can use the GetErrorCode method to determine the type of error and display application-specific messages instead of system messages. GetErrorCode
    This method gets an error code specifying the type of error encountered during the request or response. Use this method when SetShowErrors is false and GetSuccess returns "false". Code values are given in the example below.
        Example:
    
        if (! http.GetSuccess()) {
          var err = http.GetErrorCode();
          var msg = '';
          switch (err) {
            case 0:  msg = 'No Error';         break;
            case 1:  msg = 'Parse Error';      break;
            case 2:  msg = 'Host Not Found';   break;
            case 3:  msg = 'Invalid Socket';   break;
            case 4:  msg = 'Socket Error';     break;
            case 5:  msg = 'Invalid Response'; break;
            case 6:  msg = 'Send Failed';      break;
            case 7:  msg = 'Receive Error';    break;
            case 8:  msg = 'User Canceled';    break;
            default: msg = 'Unknown Error';
          }
          sys.WarningBox('HTTP Request Failed\nError Code: ' + err + ' - ' + msg);
          return;
        }
    
    GetResponseSize
    This method gets the size in bytes of the data received from the remote server. GetResponseData
    This method gets the actual data received from the remote server. Tokenize
    This method tokenizes the data in the http receive buffer into one or more separate strings, based on the specified delimiter. It returns an integer that is the number of tokens in the buffer. If no delimiter is specified, a newline character (decimal 10) is used and carriage returns (decimal 13) are stripped out of the data. This method and the GetToken method may be used to process very large received data values, while avoiding the possibility of exceeding size limits on script variables, etc. GetToken
    This method gets the string value of a token in the http receive buffer. The http.Tokenize method must have been used first. It returns a string that is the N'th token in the buffer, based on the delimiter last specified by the Tokenize method. FreeTokens
    This method resets the tokenizing values (delimiter etc.) set by the Tokenize method. It does not affect the contents of the http receive buffer.


    RPC Methods
    These methods are used with the global "rpc" (remote procedure call) object to prepare and run a host call to run a remote procedure on a server.

    SetURL
    This method creates the URL string that will be used to run a host procedure. It includes the "http://<host>" string, any required script string for the middleware, and the name of the remote program to be run (Progress) or the name of the stored procedure (Oracle). Specific formatting of the URL must conform to the host middleware being used. When constructing the hostname portion and script portion, the "preference.GetPreference(prefName)" method is useful (see below). AddNameValuePair
    This method assigns a name/value pair to be used as an input parameter for the host call. DisplayURL
    This debugging method displays a message box with the URL value set by the latest call to the SetURL method. DisplayParams
    This debugging method displays a message box with the CGI parameters (name/value pairs) that were set by the latest calls to the AddNameValuePair method. Execute
    This method executes (runs) the host call to the remote server.
    FTP Methods
    These methods are used with the global "ftp" object to send a binary file to a remote host, or to retrieve a binary file from a remote host.

    Get
    This method gets a binary file from a remote server and save it into a specified directory on the client system. Put
    This method sends a binary file from a specified directory on the client system to a remote server and saves it into a specified directory on the remote system.
    Preferences Methods

    These methods are used with the global "preference" object to get the values of named preference properties of a specified app. Each app has its own separate set of these preference properties that were loaded from a startup "ini" file, "inherited" from the app that opened the current app, or dynamically created by an app during an execution session, using the SetProperty method below.

    An example of a preference is "UserGroup=sales", where "UserGroup" is the preference name and "sales" is the preference value (i.e. a name/value pair).

    Each preference is a case-sensitive property of the "preference" object, specified by its app name and preference name, and has get/set methods to obtain or assign its value.

    Preferences can be a useful way to pass values between apps without using GUI components such as textfields that consume more system resources. Also, establishing a standard naming convention for using preferences for inter-application communication can improve encapsulation and reduce undesirable dependencies such as one app needing to know any details about another app's internal structure.

    GetPreference
    This method gets the string value of a specified preference property for the current app. If the specified property is not found for the current app, an error message will be displayed and no value will be returned. GetProperty
    This method gets the string value of any preference property of any app that is open. The optional third parameter indicates if the preference is required (true) or optional (false). The default is "true". If the third parameter is "false" and the preference is not found, the method returns an empty string and does not display any error message. If the third parameter is "true" or not specified, and the specified property is not found, an error message will be displayed and no value will be returned. SetProperty
    This method assigns a string value to any preference property of any app that is open. The specified preference may be an existing one that was loaded from the startup "ini" file, such as "HostURL" or "Script", or that was previously created by this method. If the specified property does not already exist as a preference of the specified app, it will be created.
    Barcode Scanner Methods
    These methods are used with the global "symbol" and "psc" objects to enable/disable certain Symbol and PSC Falcon barcode scanners, primarily those found in PalmOS and WindowsCE based Symbol and PSC handheld devices. (Most other barcode scanners work like inline PC wedge scanners, placing the scan results into whichever text component currently has focus in a window). When a scan is done, a function is run that was previously registered with SetScanProc. This function can obtain and display scan results in a textfield or other component. A frame method is also available to determine which component currently has focus.

    To conserve battery life in the handheld device, enable the scanner only when on an input frame where such scanning will be done and disable it when leaving that frame, because enabling the scanner causes a power drain.

    OpenScanner
    This method enables the use of the barcode scanner. CloseScanner
    This method disables the use of the barcode scanner. Set Scan Process
    This method sets the name of a script function that will be run upon successful completion of a barcode scan. Get Scanned Data
    This method returns the data from the last successful scan.
    Serial Port Methods
    These methods are used with the global "ser" object to use serial ports (COM1, COM2, etc) to communicate with printers, mag stripe readers, and other input/output peripherals.
    Open
    This method opens the specified serial port with the specified data communication parameters. A typical set of values for the serial port on a PDA is port=0 baud=19200 data=8 stop=1 parity=none flowctrl=none Set Receive Callback Procedure
    This method runs a specified function in a specified app when a specified data string is received from the currently open serial port. This method can be used with mag card readers and other serial devices that can send data to a serial port that contains a known termination string such as a newline or carriage return or other string. Receive
    This method receives data from the currently open serial port. Note, this method may return more than the requested number of bytes if there are more available in the buffer. It may return less than the requested number of bytes (possibly zero) if the timeout expires before receiving the requested number of bytes. Send
    This method sends data to the currently open serial port. Close
    This method closes the currently open serial port.
    Infrared (IR) Port Methods
    These methods are used with the global "irda" object to use the IR (Infrared) port to communicate with printers, mag stripe readers, other PDAs, and other input/output peripherals. (Note: IRDA is an acronym for the Infrared Data Association, a group of device manufacturers that developed a standard for transmitting data via infrared light waves, which these methods use).
    Open
    This method opens the IR port. Send
    This method sends data to the IR port. Close
    This method closes the IR port if it was previously opened.
    File System Methods
    These methods are used with the global "jsifile" object to interface with the native file system of the client device. When specifying pathnames in Windows, either a single forward slash ('/Temp') or two backslashes ('\\Temp') can be used as path separators.
    Exists
    This method tests if a file with the specified name already exists. Open
    This method opens a new file for output. If a file with the same name already exists, it will be overwritten. You can use "Exists" to test for this before using "Open". Any specified directories (folders) must already exist, this method will NOT create them. Note that for Windows filenames, the path separator character "\" must be escaped ("\\"). Write
    This method writes data to an output file. The data is a string value of any (reasonable) size. It may contain newlines and other nonprintable characters. Close
    This method closes the output file that was previously opened. Delete
    This method deletes the specified file, which may include a full or relative path. If the file or path does not exist, no action is taken and no warning is displayed. Note that for Windows filenames, the path separator character "\" must be escaped ("\\"). Copy
    This method copies the specified file, which may include a full or relative path. If the file or path does not exist, no action is taken and no warning is displayed. Note that for Windows filenames, the path separator character "\" must be escaped ("\\"). Rename/Move
    This method renames and/or moves the specified file, which may include a full or relative path. If the new path is different than the old path, this also moves the specified file to the new location. If the file or path does not exist, no action is taken and no warning is displayed. Note that for Windows filenames, the path separator character "\" must be escaped ("\\").
    Signature Capture Methods
    These methods are used with the global "signature" object to open a window where a signature can be entered and captured to a local BMP image file. This object is supported on all platforms except PalmOS devices.

    All methods except the "new" method are used with the handle of a specific instance of this object. Handles may be stored in integer script variables that are initialized to zero. Test for a valid handle by checking for a non-zero value.

    new
    This method creates a new instance of the signature capture object. Set File Name
    This method specifies a local pathname where a signature can be captured as a BMP image file. Show
    This method opens a special "signature capture" window where a signature can be entered and saved. The window contains an entry area which captures mouse or stylus motions as line drawings within an image area, and three buttons (Accept, Clear, and Cancel). If Accept is selected, the entered image is captured to the previously specified filename and the window is closed. Clear will clear the image entry area. Cancel will close the window without saving an image.
    Video Capture Methods
    These methods are used with the global "video" object to interface with a video camera via a special third-party DLL file. The video can be displayed within a panel container, and individual snapshots can be captured to local JPG image files. This object is supported on 32-bit Windows platforms only (ReaderWIN.exe).

    All methods except the "new" method are used with the handle of a specific instance of this object. Handles may be stored in integer script variables that are initialized to zero. Test for a valid handle by checking for a non-zero value.

    Requires installation of the CapturePRO3.dll (from Pegasus Imaging Corp). Copy the DLL to a directory of your choice, then open a command (DOS) window in this directory and enter "regsvr32 CapturePRO3.dll".

    The documentation for Version 3.2 of Pegasus CapturePRO(TM) says:

    CapturePRO interfaces with any video capture device that supports USB, FireWire, WDM, or native DirectShow including legacy Video For Windows devices. CapturePRO contains managed .NET, COM and VCL components (CapturePRO and TwainPRO) that perform image and video acquisition from video capture devices. CapturePRO is designed to connect to any video capture device that supplies a DirectShow (WDM) device driver. Most capture devices currently on the market (video capture cards, PC cameras, etc.) supply this type of driver. In addition, legacy Video for Windows devices are typically available via a DirectShow WDM / VfW translation driver.

    new
    This method creates a new video window inside a panel. The panel should have large X/Y padding values (e.g. iPadX="320" iPadY="240"). Connect
    This method connects a video window to an input video source. Preview
    This method displays the video source in the window. Capture
    This method captures a still image of the current video source to a specified local file, as a JPG image file. Disconnect
    This method disconnects the video source.

     Up to Top     Return to Help Index