home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
SAMPLFLD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-12-03
|
3KB
|
70 lines
/*****************************************************************************/
/* */
/* RXWINDOW field usage example */
/* */
/* This example illustrates the creation of entry fields in a window, */
/* including the ability to change field attributes and make protected */
/* and masked fields. */
/* */
/*****************************************************************************/
field_data.1 = 'Normal field 1'
field_data.2 = 'Normal field 2'
field_data.3 = 'Masked field'
field_data.4 = 'Protected field 1'
field_data.5 = 'Protected field 2'
do forever
window = w_open(2, 3, 23, 60, 48)
call w_border window, 1
call w_put window, 2, 2, 'Please type your name.'
/* usage of W_GET with a pad character */
name = w_get(window, 3, 2, 20, , , '_', 'f')
call w_put window, 3, 2, 'Hello,' name
call w_put window, 4, 2, 'Key pressed:' c2x(_activation_key) '(hex)'
call w_put window, 5, 2, 'Key name:' _activation_keyname
call w_put window, 7, 2, 'Type in the following fields, end with Enter:'
/* create some fields with names "FIELD.x", padded with '.' */
do i = 1 to 5
call w_field window, 'field.'i, 7+i, 3, 30,, '.'
/* put some data in the fields */
field.i = field_data.i
end
/* use W_FIELDSET to make some fields protected with special color */
call w_fieldset window, 'field.4', 60, , 'p'
call w_fieldset window, 'field.5', 60, , 'p'
/* make field masked with '*' */
call w_fieldset window, 'field.3', 62, , , '*'
/* usage of W_READ, with cursor initially in field.2 and request for
a list of changed fields */
call w_read window, 'field.2', 'f', 'changed.'
call w_put window, 19, 2, 'Key pressed:' c2x(_activation_key) '(hex)'
call w_put window, 20, 2, 'Key name:' _activation_keyname
call w_put window, 21, 2, 'Cursor was in' _activation_field
/* display new values of the fields */
do i = 1 to 5
row = 13 + i
call w_put window, row, 3, 'field' i '=' field.i
do j = 1 to changed.0
if changed.j = 'FIELD.'i then do
call w_put window, row, 40, '(changed)'
leave
end
end
end
call w_put window, 22, 2, 'Press any key to continue, ESC to exit.'
key = inkey()
call w_close window
if key = '1b'x then
leave
end