Dear All
I am getting the below errors while using read and readln functions.
*************************************************** READ(i_f, PrcObj^.state); ReadLN(i_f,CurPar^.bvalue);
error1: argument to `Read'/`ReadLn' from `Text' file is of wrong type error2: argument to `Read'/`ReadLn' from `Text' file is of wrong type
***************************************************
i_f : TEXT;
'CurPar' is a record and the bvalue is a boolean variable
'PrcObj' is a record and 'state' is of 'state_list' type
state_list = (downed, install, stopped, waiting, started, running);
Regards Hari
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
vanam srihari kumar wrote:
I am getting the below errors while using read and readln functions.
READ(i_f, PrcObj^.state); ReadLN(i_f,CurPar^.bvalue);
error1: argument to `Read'/`ReadLn' from `Text' file is of wrong type error2: argument to `Read'/`ReadLn' from `Text' file is of wrong type
Reading Boolean and enum values are a Sun Pascal extension that GPC doesn't yet support. We could add it in a future version, but at the moment (and without upgrading GPC), you'll have to change the code.
(You could look at StrReadEnum in the StringUtils unit that comes with GPC, but you'll need some extra work when using it. Or you could write something similar yourself.)
Frank