PROGRAM NameRegistration;
VAR
FirstName, FileName : TEXT;
Age, Height, Weight : INTEGER;
BEGIN
WRITELN ('Please enter your First Name: ');
READLN (FirstName);
(* ---- Beginning of Error Control ---- *)
IF FirstName = '' THEN
BEGIN
WRITELN ('<<You must enter a First Name!>>');
READLN;
WRITELN;
WRITELN ('Please enter your First Name: ');
END;
(* ------- End of Error Control ------- *)
WRITELN ('Please enter your Age: ');
READLN (Age);
WRITELN ('Please enter your Height: ');
READLN (Height);
WRITELN ('Please enter your Weight: ');
READLN (Weight);
WRITELN;
WRITELN ('[Hit Enter to Begin Process]');
READLN;
(* --- Beginning of File Operations --- *)
ASSIGN (FileName, 'C:\WINDOWS\DESKTOP\test.txt');
REWRITE (FileName);
WRITELN (FileName, 'First Name: ', FirstName);
WRITELN (FileName, 'Age: ', Age);
WRITELN (FileName, 'Weight: ', Weight);
WRITELN (FileName, 'Height: ', Height);
CLOSE (FileName);
(* ------ End of File Operations ------ *)
END.
Bon quand je compile ces ligne de codes dans un compilateur, il me donne ces 2 erreurs:
ERROR: (18,5): Type mismatch <----- le IF
ERROR: (43,37): Invalid expression <------ La partie FirstName en gras
Je ne vois pas les erreurs dans ces lignes... p-e vous en voyez?
Message édité par neosparky le 19-06-2003 à 01:52:53
---------------
Aime son JAVA bien chaud le matin.