if Length(Rec[C].FieldText) <> '0' then begin
This won't even compile.
You're comparing Length(), which results in a number, with a character.
If you think this is correct you don't understand Pascal.
And if you don't see that this is an error you don't understand Pascal.
Didn't you try compiling this? Didn't you see it gave an error?
Couldn't you solve that error
before posting this code?????
The only thing, other then not completing this assignment, is remove the complete "for Camp" loop and start that part over.
Look at what you've got at that point (at the point of "for Camp").
You have the following data:
Rec[I].Fieldnr
Rec[I].FieldText
(
where I = 1 to N)
So potentially you have (
in case of N=4)
Rec[1].Fieldnr
Rec[1].FieldText
Rec[2].Fieldnr
Rec[2].FieldText
Rec[3].Fieldnr
Rec[3].FieldText
Rec[4].Fieldnr
Rec[4].FieldText
You need to write
all Rec[ x ].Fieldnr
and Rec[ x ].FieldText to disk IF (
and only IF) Rec[ x ].FieldText <> '' (or Length(Rec[ x ].FieldText) <> 0 which is the same).
So you need to construct a loop where you do that.
After that your assignment is complete. You're so close.
You should be able to create this loop.