Learner not getting 1st part of procedure to run 
Author Message
 Learner not getting 1st part of procedure to run

I have entered below the procedure that I think is messing up the
program I am writing.  If NewWorker is Y or y, it runs the
Worker_Details ok, but if NewWorker is N or n the program does not
crash, but the user screen does not display the line "No more workers
will be entered".  Can anyone see where the problem lies with this?  I
am just going in circles trying to figure it out.

Thanks in advance
George

Procedure New_Worker;
        begin
        repeat
                While not ((NewWorker = 'N') or (NewWorker = 'n'))
                and not ((NewWorker = 'Y') or (NewWorker = 'y')) do
                begin
                        writeln('You have entered an incorrect value');
                        writeln('Please try again');
                        readln(NewWorker);
                end;
                If (NewWorker = 'N') or (NewWorker = 'n') then
                begin
                        writeln('No more Workers will be entered.');
                        close(EmployeeFile);
                        reset(EmployeeFile);
                        Collection;
                end
                else Worker_Details;

        until (NewWorker = 'N') or (NewWorker = 'n');

        end;



Thu, 05 Aug 2004 22:44:24 GMT  
 Learner not getting 1st part of procedure to run


Quote:
>I have entered below the procedure that I think is messing up the
>program I am writing.   ...

What you have should work.  If you are running it in the TP 7 IDE (or
some others), the screen will close when the program finishes.  You
can run the EXE from DOS, or add something like this to the end:

write( 'Program finished.  Press ENTER');
readln;

to keep the screen from closing.



Thu, 05 Aug 2004 23:32:33 GMT  
 Learner not getting 1st part of procedure to run
On Sun, 17 Feb 2002 10:32:33 -0500, Jan Philips

Quote:



>>I have entered below the procedure that I think is messing up the
>>program I am writing.   ...
>to keep the screen from closing.

Also, after the program finishes running in the TP IDE, Alt-F5 shows
the output screen.


Thu, 05 Aug 2004 23:34:27 GMT  
 Learner not getting 1st part of procedure to run
Thanks for the tip.
Unfortunately I think this means I have a problem with the validation
and writing to files.  I used to like a challenge, but...

George

Quote:

> On Sun, 17 Feb 2002 10:32:33 -0500, Jan Philips



> >>I have entered below the procedure that I think is messing up the
> >>program I am writing.   ...

> >to keep the screen from closing.

> Also, after the program finishes running in the TP IDE, Alt-F5 shows
> the output screen.



Sat, 07 Aug 2004 08:07:16 GMT  
 Learner not getting 1st part of procedure to run


Quote:
>Thanks for the tip.
>Unfortunately I think this means I have a problem with the validation
>and writing to files.  I used to like a challenge, but...

Try putting a readln; after the write statement that isn't being seen.
See if that nakes it stay on the screen.


Sat, 07 Aug 2004 09:02:34 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Application GPF's 1st time run, why?

2. Getting whole and fractional part of a float

3. DELPHI: Run-time type info on published parts?

4. Getting a list of running Windows programs

5. Getting a dataset from a Oracle procedure

6. Help: Getting a dataset from an Oracle procedure

7. Getting Return Value in Stored Procedures ??

8. Getting a run for a TPW proggy

9. PDox Table not getting updated

10. Getting file *creation* date, not modified date

11. Why am I not getting the RTE 200?

12. Effective programming w/ loops...not getting it :(

 

 
Powered by phpBB® Forum Software