PDA

View Full Version : scripts syntax


ABC123

dik_coleman
06-09-2002, 04:39 AM
Scenario

Have db with 6 numeric fields
Need to use each field as source key for updates in another db.
Need to repeat for multiple records in first db.

trying to write a "loop" type script so that one segment will do all six fields, press the down arrow and repeat for "x" number of times.......

Don't want to have to write code to read each field and then "play" the update routine.
Fields are evenly spaced across screen.

Set #row, #col, #len in one command. Only #col has to change to read multiple fields......

HOW DO YOU CHANGE IT????????

I have tried every way that I can think of to index the col position for the next read command, but nothing seems to work. I realize that the date is $text so I have tried both the "val" and "chr" functions to make it work.... when I try to add 25 and 5, I get 255 or CRASH. A review of the variables shows garbage in the field......

Any ideas anyone????

Dick Coleman

Gary Smith
06-11-2002, 08:04 AM
Try the {FIELDGOTO} script function. It is not dependant on row and column. Might be easier to control.

Gary Smith
06-11-2002, 08:53 AM
Your script could do the following:

1. Open source db and view or browse.
2. Ctrl-Home to goto the first record.
3. Set 6 variables to the values of the 6 numeric fields.
4. Update the 2nd db using the 6 variables.
5. {DN}
6. Repeat until end of file.

There is no need to place the cursor on each of the 6 fields in order to store each field's value in a variable.

Hope this helps.