Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GET & SET

Status
Not open for further replies.

edc000

Programmer
Mar 4, 2011
28
0
0
AR
When I do a verification of the existence of a value and then modified, do this:

TABLE:COD=X
GET(TABLE,TABLE:KEY)
IF ERRORCODE()
..
END
TABLE:COD=X
SET(TABLE:KEY,TABLE:KEY)
NEXT(TABLE)
TABLE:NOM='XXXX'
ACCESS:TABLE.UPDATE()

because I'cant GET to modify the data, but yes with the SET. At the same time, if I use the SET / NEXT then I can not corroborate the FIELD = VAR because always return yes!.

There is a more flexible working? Thanks.
 
Hi!

1. You need to use a CLEAR(TABLE:RECORD) before a GET or SET to make sure that the record buffer is empty.

2. GET() will work ONLY is the Key is UNIQUE.

3. When you use SET(), you should ALWAYS check if the record key is the one you want before you update it i.e.

Code:
TABLE:COD=X
SET(TABLE:KEY,TABLE:KEY)
NEXT(TABLE)
IF NOT ERRORCODE() AND TABLE:COD = X
   TABLE:NOM='XXXX'
   ACCESS:TABLE.UPDATE()
END

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top