home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR19
/
SNIP0693.ZIP
/
GETS.PRG
< prev
next >
Wrap
Text File
|
1992-09-05
|
1KB
|
42 lines
David, you have to understand how the GET system works in 5.01. You
should NEVER place the variable i a valid anymore, there are far more
reliable methods:
instead do the following:
@ x, 3 GET a_Gets[x] VALID {| oGet | somefunc( oGet ) }
.
.
READ
// validation:
Function SomeFunc( oGet )
local MyVar:=oGet:VarGet()
// perform validation....
.
.
.
// if you must write a NEW value back into the GET, then perform
// the following:
oGet:VarPut( MyVar ) // places new value back, takes care
// any messy array handling!
oGet:Display() // redisplays the NEW value!!
// as appropriate....
return( lValid ) // did the validation work or not??
The Get system uses a code block for VALID now, and the block is always
passed the current GET object (allowing us to retrieve and set values
using built in Get methods as I indicated above). If you do it that way,
you will NOT have any problems with arrays.
BTW your original problem was associated with the compiler - it turned
your old VALID into a code block, which contained a LIVE reference to
the variable 'x'. When the GET actually went through a validation
process (during READ), 'X' had the value "3" in it - and THAT value was
placed into the code block as it was executed!!!