I have something to know here about the MARK option with REINPUT statement.
I have a table (on the map). I am trying to add a record at tbe bottom.
For validation purpose, I am checking if all the fileds are containing good data or not. If any field is left blank, I am throwing an error message with the reinput statement and trying to put the cursor on the blank field of the last line with following statement
REINPUT FULL MARK *FIELD(#I)
I is the row number where I am inputting the values.
But the dursor is not positioning on the field rather positions at the first field of the first row. But if I write
REINPUT FULL MARK *FIELD-NAME(5), it positions the cursor at 5th row and desired field.
Can someone please help me out with with the reason?
Is the field, where you want to put the cursor, modifiable?
That means:
Has it a attribute definition like (AD=O) ?
Has it a control variable assigned, that makes the field protected?
In the following example the cursor will be placed correctly, if #I = 1 thru 3 and #I = 5, but not if #I = 4. In this case, the cursor will be placed in the first occurence of the table.
DEFINE DATA LOCAL
1 #A (A1/5)
1 #I (N1)
1 #CV (C)
END-DEFINE
*
MOVE (AD=P) TO #CV
*
INPUT 5/5 #A (1) /
5T #A (2) /
5T #A (3) /
5T #A (4) (CV=#CV) / /* or (AD=O)
5T #A (5) ///
5T #I (AD=M SG=OFF) ‘mark #I with 0 to escape’
*
IF #I > 0
REINPUT FULL ‘ERROR’ MARK FIELD *#A (#I)
END-IF
END