OP Set option

4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next

version 1.5


OP Set option (optionNumber; optionValue) Longint

ParameterTypeDescription
optionNumberLongintNumber of the option to set
optionValueLongintValue to which to set the option
Function resultLongintError code result for the function

Description

OP Set option lets you set some operating options for 4D Open for 4th Dimension.

The codes for optionNumber and optionValue are listed in the following table:

OptionValueDescription
  1 1 / 0Turn parameter checking mode On/Off. On is the default.
  2 1 / 0Turn Error dialog box On/ Off. On is the default.
  3 1 / 0Caching structure information is or is not authorized.
  4nElement bound when arrays are used with record routines.
Default is element zero.
(NCID*65536)+ Code1 / 0Set a network component option. See the following code table.

Option 1 - Parameter checking mode

When parameter checking is on, 4D Open for 4th Dimension checks the validity of the parameters. For example, if a parameter is the table number of the served database, the program senda a request to check whether or not the table exists. This option is on by default. You can turn it off by calling OP Set option(1;0). Checking the parameters slows down operations.

Option 2 - Error dialog box option

This option, which is on by default, displays the Error dialog box when an error occurs.

Option 3 - Caching structure information

This option, which is off by default, tells 4D Open for 4th Dimension whether or not caching structure calls can be made. You can turn it on by calling OP Set option(3;1). Once the option has been turned on, you can use the OP Cache structure routine. Caching the structure speeds up some operations.

Option 4 - Binding with arrays

When you use arrays in binds, the element 0 is used for record routines by default. You may change this element using OP Set option (4;ElementNumber).

Network component options

OP Set option allows you to set some options for your network component. This features allows expert users to change some of the connection parameters. 4D Open for 4th Dimension does not check the options you have set; some changes may lead to problems. When used this way,

optionValue = (NCID * 65536) + Code of option to set

You can obtain NCID (the network component ID) using OP Get network component info.

Use OP Set option to set a network component option only when the network component is not currently initialized.

The codes for the options to set require detailed knowledge of the network components and should be used only by expert programmers. The codes are:

CodeNameDescription
1VersionThis field indicates the version of the network component.
You must NOT modify the value of this field.
2LockDelayThis field is used by the ADSP component when used with 4D Client.
You must NOT modify the value of this field.
3IdleDelayThis field must be equal to zero.
4BufferSizeThis field indicates the size (in bytes) of the communication buffers
used by the network component.
5PackOptionThis field tells the network component to perform automatic data
compression when sending a data buffer over the network.
6MinPackSizeIf PackOption is equal to 1 (data is compressed), this field specifies the
minimum size (in bytes) of the buffers to be compressed.
7MaxPackSizeIf PackOption is equal to 1 (data is compressed), this field specifies the
maximum size (in bytes) of the buffers to be compressed.
8DelayVoyantThis field must be equal to 0.
9Product IDThis field specifies the type of application in which the network
component is running.
10FlagsThis field is a set of 32 bits. Each bit is set to either 1 or 0 depending on
the value of the corresponding option for the network component.

Error Codes

If OP Set option executed successfully, it returns 0. Otherwise, it returns the following errors:

Error CodeDescription
-192Resource not found.
10128The 4D Open for 4th Dimension package has not been initialized.
10132The network component is currently in use.
10148Unknown option requested to 4D Open for 4th Dimension.
10154This command cannot be executed right now.
10165Unknown network component option.

Example

In this example, 4D Open for 4D checks the validity of parameters while in a debugging phase. At a more advanced stage of debugging, it also turns structure caching ON.

   If (<>vDebugLevel >= checkParams )
      ` Debug phase is in progress, set parameter checking on for improved security
      ` Set parameters checking option(option 1)  ON (value 1) for 4D Open
      $errCode := OP Set option (1;1 )
      
   Else
      ` Debug phase is very advanced, remove parameter checking for improved performance
      ` Set parameters checking option(option 1)  OFF (value 0) for 4D Open
      $errCode := OP Set option (1;0 )
      If (<>vDebugLevel = final )
         ` No more debugging, server structure is final, start caching structure information
         $errCode : = OP Set option (3;1)
         $errCode := OP Cache structure (vConnectID;1)
      Else
         $errCode : = OP Set option (3;0)
      End if
   End if

See Also

OP Get option.


4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next