I_READONLY

Set read-only state for input fields

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall I_READONLY([D_OFF|D_ON,] [subfunction,] arguments)

Arguments

D_OFF

(optional) Set specified fields to read/write. (n)

D_ON

(optional) Set specified fields to read-only. (default) (n)

subfunction

(optional) One of the following, which determine which fields will be affected. (n)

D_ALL

Set the read-only state for all fields in the specified window.

D_FLDS

Set the read-only state for individually specified fields. (default)

D_SET

Set the read-only state for all fields in the specified input set.

arguments

One or more arguments, depending on subfunction.

Discussion

I_READONLY enables you to set the read-only state of one or more input fields in an input window, regardless of the current input context.

This routine differs from I_FLDMOD in that it can set the read-only state for multiple fields, and it preserves the contents of affected fields. (I_FLDMOD can set the read-only state for only one field, and it initializes the field.) If an affected field is empty when I_READONLY is called, it will remain empty. If the field has text, I_READONLY will preserve the text.

If a field specified in a call to I_READONLY can’t be set to read-only (in other words, if the field is a check box, a radio button set, or a field with a selection list or selection window), a read-only setting will be accepted, but it won’t affect the field. (For these field types, use I_DISABLE rather than I_READONLY.) However, if the field is subsequently changed to a regular text field, Toolkit may use this setting because when a field is changed to a text field, the most recent read-only state setting is used to determine whether the field will be read-only or read/write.

Notes on input methods for information on changing read-only settings from an input method

D_ALL

xcall I_READONLY([D_OFF|D_ON,] D_ALL, window_id)

Arguments

D_OFF

(optional) Set specified fields to read/write. (n)

D_ON

(optional) Set specified fields to read-only. (default) (n)

window_id

The ID of the input window whose fields you want to modify. (n)

Discussion

The D_ALL subfunction of I_READONLY enables you to set the read-only state for all the input fields in an input window.

Examples

The following examples set all the fields in a window (the window whose ID is stored in win_id) to read-only:

xcall i_readonly(D_ON, D_ALL, win_id)
xcall i_readonly(D_ALL, win_id)

The next example sets all the fields in a window to read/write:

xcall i_readonly(D_OFF, D_ALL, win_id)

D_FLDS

xcall I_READONLY([D_OFF|D_ON,] [D_FLDS,] window_id, field_spec[, ...])

Arguments

D_OFF

(optional) Set specified fields to read/write. (n)

D_ON

(optional) Set specified fields to read-only. (default) (n)

window_id

The ID of the input window whose fields you want to modify. (n)

field_spec

One or more field specifications. (a)

Discussion

The D_FLDS subfunction of I_READONLY enables you to set the read-only status for a specified field or list of fields in an input window. If a specified field does not exist in the input window, a fatal error will occur.

You can specify up to nine field names in field_spec and up to nine field specifications (nine occurrences of field_spec), which enables you to specify a maximum of 81 fields per D_FLDS call. The maximum length of field_spec is 99 characters. Additional characters are ignored.

To specify multiple field names in field_spec, separate them with any character except alpha characters, numeric characters, dollar sign ($), underscore (_), and square brackets ( [ or ] , which are used to enclose dimension specifications for repository arrayed fields). For example, the following could be passed as a field_spec:

"name, b_day, hr_dt, soc_sec, emp, policy, phone, conditions[2,4]"

Examples

The first two examples set the specified fields (which are the same in both cases) to read-only. One difference is that in the second example the defaults are used for the operation (D_OFF/D_ON) and the subfunction, so those argument have been omitted. Another difference is that in the first example, the fields have been grouped into three field_spec arguments, while in the second example, the fields have been grouped into two field_spec arguments.

xcall i_readonly(D_ON, D_FLDS, win_id, "name, b_day, hr_date, soc_sec",
&     "employer, policy, phone, fax, email", "addr[1,1], addr[1,2], addr[1,3]")

xcall i_readonly(win_id, "name, b_day, hr_date, soc_sec, employer",
&     "policy, phone, fax, email, addr[1,1], addr[1,2],addr[1,3]")

The following examples set the specified fields to read/write:

xcall i_readonly(D_OFF, D_FLDS, win_id, "name, b_day, hr_date, soc_sec",
&     "employer, policy, phone, fax, email","addr[1,1], addr[1,2], addr[1,3]")
xcall i_readonly(D_OFF, win_id, "name, b_day, hr_date, soc_sec,
&     employer", "policy, phone, fax, email, addr[1,1], addr[1,2], addr[1,3]")

D_SET

xcall I_READONLY([D_OFF|D_ON,] D_SET, window_id, set_name)

Arguments

D_OFF

(optional) Set specified fields to read/write. (n)

D_ON

(optional) Set specified fields to read-only. (default) (n)

window_id

The ID of the input window whose fields you want to modify. (n)

set_name

(optional) The case-insensitive name of an input set. (a)

Discussion

The D_SET subfunction of I_READONLY enables you to set the read-only state for all the fields in an input set.

If the specified input set does not exist in the window, a fatal error will occur.

Examples

The following examples set all the fields in an input set (the input set whose name is stored in in_set) to read-only:

xcall i_readonly(D_ON, D_SET, win_id, in_set)
xcall i_readonly(D_SET, win_id, in_set)

The next example sets all the fields in an input set to read/write:

xcall i_readonly(D_OFF, D_SET, win_id, in_set)