
Yes i need to display this in a subfile , Please let me know the logic behind it ? do u mean i need to setll teh file with value as R? will it fetch the records starting with R?

…to setll teh file with value as R? will it fetch the records starting with R?
First, a value such as ‘R*’ would normally mean only records that started with ‘R’. That’s not quite the same as positioning to ‘R’ and reading records from that point on.
Records after ‘R’ would also include records that started with ‘S’ and ‘T’ and all later records. But ‘R*’ would mean that you stop reading as soon as you reached the first record that was after any ‘R’ record.
So, how do you really want your input field to work? If one user enters ‘R*’ and another user enters ‘R ‘, do you want your program to handle those differently?
Tom

Hi Tom, as i told is a 2 byte field, user can either enter ‘R*’ or ‘RV’.
In case of ‘RV’ i will have corresponding field in the file to directly key with and load alll records that have key field FLTYPE value as ‘RV’.
In case of ‘R*’ it should load only records that start with ‘R’(i.e all the records which has the FLTYPE = values that start with R,Like RV,RS,RP,RJ etc. )
Ideally my input field should filter the records based on the value given in the 2 byte screen field.

At the same time it should exclude the next set of records that start with character other than ‘R’.

If subst(fieldIn,2,1) = ‘*’;
StrPos = subst(fieldIn,1,1);
EndPos = subst(fieldIn,1,1) + ‘Z’;<– endinb position is the first char + a high value
else; //Case where fieldin is used for start and end
StrPos = fieldin;
EndPos = fieldin;
endif;
Setll StrPos MyFile;
then you are ready to read records and load your subfile .. until Keyfld > EndPos;
Phil

















