PROFILE


PLBCMP GUI Only

 

The PROFILE compiler directive defines the statement syntax for a specific WINAPI statement. The instruction uses the following format:

 

 

label

PROFILE

{dll},{entry},{rettype}[,{parmtype}...]

 

Where:

label

Required. A Data Definition Label.

dll

Required. The name of the Dynamic-Link Library to load.

entry

Required. The name of the entry point within the Dynamic-Link Library to call.

rettype

Required. The type (from the table below) of the data returned.

parmtype

Optional. The type (from the table below) of the data passed to the Dynamic-Link Library.

Flags Affected: NONE

Note the following:

  1. The PROFILE statement is used by the compiler to verify the format of the parameters to a WINAPI statement and to define the Dynamic-Link Library (DLL) name and the entry point.

  2. {dll} is case sensitive and must be specified exactly as the DLL documentation specifies it. If the DLL is not in the normal Windows path, the path must also be specified.

  3. When running under the PL/B Application Server, a {dll} name beginning with an exclamation mark (!) signifies that the DLL resides on the client rather than the server.

  4. {entry} is case sensitive and must be specified exactly as the DLL documentation specifies it.

  5. {rettype} and {parmtype} are keyword parameters that inform the compiler what type of variables and how many to expect. They must be one of the following:

  6.  

    Keyword

    Defines ...

    DIM

    a string data type (DIM).

    INT1

    an INTEGER of one byte.

    INT2

    an INTEGER of two bytes.

    INT4

    an INTEGER of four bytes.

    INT8

    an INTEGER of eight bytes. (9.0)

    PDIM

    a string data type (see below).

    PINT1

    a pointer to an INTEGER of one byte.

    PINT2

    a pointer to an INTEGER of two bytes.

    PINT4

    a pointer to an INTEGER of four bytes.

    PINT8

    a pointer to an INTEGER of eight bytes. (9.0)

    NONE

    nothing is returned (valid only for {rettype}).

     

  7. When a DIM type is an input for a WINAPI, the Form Pointer is always set to a value of one and the Length Pointer is always set to Physical Length.

  8. The PDIM is the same as a DIM type except WINAPI does not change the Form Pointer or Logical Length values when the DIM variable is being passed as input. If a PDIM is used, the user program has full responsibility for the Form Pointer and Logical Length values for any input DIM variables used.

  9. If {entry} is a UNICODE enabled function, the name must have a character 'A' or 'W' appended to it. A UNICODE enabled function may be determined when a parameter of the API function is a string variable. The 'A' character indicates that the string parameters contain ASCII zero terminated data. The 'W' indicates that the string parameters contain UNICODE string data.

  10. All DLL's must be 32 bits. The WINAPI instruction does not call a 16 bit DLL.

  11. PLBNET, PLBCE, and PLB Linux are limited to twenty parameters. PLBWIN has no limit.

  12. The PROFILE instruction is supported by the PL/B Web Client JavaScript functions.

  13.  

    label PROFILE {lib},{entry},{rettype}[,{parmtype}...]

    Where:

    {lib}

    Required. This parameter can be specified in one of two formats:

    1. This parameter can specify the name of a Dynamic-Link Library that is to be loaded and called using the entry point specified by the {entry} function name.

    2. This parameter can be specified as the string "!JS" not including the double quotes. When this library type is used, the {entry} must be a valid JavaScript function the currently loaded in the PL/B Web Client environment. The JavaScript functions are case sensitive. The JavaScript library type is only valid when a PL/B Web Server runtime is being used. Optionally, this parameter can be specified to include a JavaScript 'iframe name' to be referenced by the JavaScript function. In this case, the {lib} parameter is specified as "!JS@iframename" not including the double quotes. An example for specifying an iframe could be the "!JS@frame1" string.

{entry}
Required. This name defines the entry point or JavaScript function to be called. This name depends on the {lib} parameter setting for this PROFILE definition.

Example:

.

 Sample to execute a PL/B Web Server test JavaScript functions named 'PlbApiTest' and 'PlbApiTest1' which can be found in the 'plbwebctls.js' JavaScript file.

.

SampJSN PROFILE !JS, PlbApiTest, INT1, DIM

SampJS PROFILE !JS, PlbApiTest, DIM, DIM

SampJS1 PROFILE !JS, PlbApiTest1, DIM, DIM

 

 

See Also: Example Code, WINAPI, Compiler Directives

 



PL/B Language Reference PLFORM %RECORDLABELS