Say I have a file of string[20] . I can easily write to this, but as soon as I try to receive the data I get incompatibility errors. So I make a string[20] variable to see if I can read into it. I cannot. It just says incompatible types. When the [20] is removed it says incompatible types string and shortstring. Any ideas of how to fix such a problem?
jason.
0
Newbie Poster
Recommended Answers
Jump to Postprogram solution28; uses crt,dos; type newtype = string[20]; var f:file of newtype; procedure game_over(s:string); begin writeln(s); writeln('press enter to quit.'); readln; halt; end; procedure write_in; var x:newtype; begin assign(f,'new.dat'); {$I-} rewrite(f); {$I+} if ioresult <> 0 then game_over('file rewrite error'); write('give me your string: '); readln(x); write(f,x); …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.