Programming Guide



sm_inquire

Gets the value of a global integer variable

#include <smglobs.h>
int sm_inquire(int property);

property
Specifies the global integer to get with one of the constants described in Table 5-8.

Returns

Description

sm_inquire gets the integer value of the global variable specified by property. To modify the value of a global integer variable, use sm_iset.

Table 5-8 lists the constants that you can supply as arguments for property:

Table 5-8 Global integer variables

Constant Meaning

I_BSNESS

Screen manager controls display? (true/false).

I_INHELP

Help level of current screen, or 0 if not in help.

I_INERROR

Is a message box up on the screen? (true/false)

I_INSMODE

In insert mode? (true/false).

I_INXFORM

In the screen editor? (true/false) Field validation routines are generally still called when in editor; they can check this flag to disable certain features.

I_MXCOLMS

Number of columns available for use by Panther on the hardware display.

I_MXLINES

Number of lines available for use by Panther on the hardware display.

I_NODISP

In non-display mode? (true/false). Initially set to false, setting this variable to true causes no further changes to the actual display, although Panther's internal screen image is kept up-to-date.

I_NOMSG

Error message display disabled? (true/false).

I_NOWSEL

LDB merge off for sm_wselect? (true/false) Normally false. True can be useful for a quick sm_wselect/sm_wdeselect pair.

SC_AFLDMDT

Bit mask that contains contextual information about the field's validation state and the circumstances under which a prototyped field function was called. Corresponds to the fourth standard argument passed to a non-prototyped field function.

SC_AFLDNO

Number of the field calling a prototyped field function. Corresponds to the first of the four standard arguments passed to a non-prototyped field function.

SC_AFLDOCC

Occurrence number of the field calling a prototyped field function. Corresponds to the third standard argument passed to a non-prototyped field function. The second standard argument, can be obtained from sm_getfield or sm_o_getfield.

SC_AGRPMDT

Bit mask that contains information about the group's validation state and the circumstances under which a prototyped group function was called. Corresponds to the second of two standard arguments passed to a non-prototyped group function. The first standard argument, a pointer to the group name, can be obtained by the fldnum property of a member widget and sm_ftog at group entry and exit. Access to the group name at group validation is not supported.

SC_BDATTR

Border attribute of screen.

SC_BDCHAR

Border character of screen.

SC_CCOLM

Current column number in screen (zero-based).

SC_CLINE

Current line number in screen (zero-based).

Example

if (sm_inquire(I_BSNESS))
sm_ferr_reset(0, "Problem #2!");
else
fprintf(stderr,"Problem #2!\n");

See Also

sm_iset, sm_pinquire, sm_pset