helpme with this readln problem! 
Author Message
 helpme with this readln problem!


Quote:
>i have a little bit problem here. see, i have coded a small program that
>will accept user input and save it to a file, and without closing that
>file, it then ask the user for another input juz for append it again. the
>problem now is, my program won't accept any second input and juz go
>straight to the line where the file will close.

Without the program I can't guess, but this one works.
Clif

Program KeyboardToFile;
{ demo program for entering lines from the keyboard and storing in a

CONST
filename = 'TEST.TXT';

VAR
MyInput, Ln:String;
f:Text;

Begin
     Writeln; Writeln; Writeln;
     Assign(f, filename);
     Writeln('Each line you enter will be stored on disk.');
     Writeln('Continue entering lines until finished.');
     Writeln('When finished, just press <Enter>');
     Writeln;
     Rewrite(f);
     Repeat
        Readln(MyInput);
        If MyInput <> '' then Writeln(f, MyInput);
     Until MyInput = '';
     Close(f);
     Writeln; Writeln('Now dispaying the contents of ', filename);
     Writeln;
     Reset(f);
     While not EOF(f) do
     Begin
          Readln(f, Ln);
          Writeln(Ln);
     End;
     Writeln; Writeln('End of file. Now deleting ', filename);
     Close(f);
     Erase(f);
WriteLn; Writeln('Press Enter');
Readln;
End.



Wed, 18 Jun 1902 08:00:00 GMT  
 helpme with this readln problem!


Quote:
> i have a little bit problem here. see, i have coded a small program that
> will accept user input and save it to a file, and without closing that
> file, it then ask the user for another input juz for append it again. the
> problem now is, my program won't accept any second input and juz go
> straight to the line where the file will close.

there's something called a loop? repeat until; while; etc? try that first


Wed, 18 Jun 1902 08:00:00 GMT  
 helpme with this readln problem!

i have a little bit problem here. see, i have coded a small program that
will accept user input and save it to a file, and without closing that
file, it then ask the user for another input juz for append it again. the
problem now is, my program won't accept any second input and juz go
straight to the line where the file will close.



Wed, 18 Jun 1902 08:00:00 GMT  
 helpme with this readln problem!

How about sharing this code with us so that we can help ?!


Quote:
> i have a little bit problem here. see, i have coded a small program that
> will accept user input and save it to a file, and without closing that
> file, it then ask the user for another input juz for append it again. the
> problem now is, my program won't accept any second input and juz go
> straight to the line where the file will close.



Wed, 18 Jun 1902 08:00:00 GMT  
 helpme with this readln problem!



Quote:
>i have a little bit problem here. see, i have coded a small program that
>will accept user input and save it to a file, and without closing that
>file, it then ask the user for another input juz for append it again. the
>problem now is, my program won't accept any second input and juz go
>straight to the line where the file will close.

Is the code some kind of state secret?

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 helpme with this readln problem!


Quote:


>>i have a little bit problem here. see, i have coded a small program that
>>will accept user input and save it to a file, and without closing that
>>file, it then ask the user for another input juz for append it again. the
>>problem now is, my program won't accept any second input and juz go
>>straight to the line where the file will close.

>Is the code some kind of state secret?

You know too much already. I'm afraid we're going to mail bomb you
now. ;)

Director of Enforcement, Pascal Source Security Task Force (PassTaf),
Tim



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. strange readln problem

2. about readln problem

3. HelpMe!

4. readln in pixel graphics

5. readln inside a procedure

6. READLN help???????????

7. Differences between READ and READLN

8. help needed with readln

9. read/readln procedures

10. Differences between READ and READLN

11. urgent : how to readln DATE ???

12. Readln

 

 
Powered by phpBB® Forum Software