Board index » delphi » Problem with ClrScr in Virtual Pascal

Problem with ClrScr in Virtual Pascal

I'm running Virtual Pascal under Win 2K.  Program compiles OK, but when run
ClrScr has no effect.  Can anyone help?

Thanks in advance.

 

Re:Problem with ClrScr in Virtual Pascal


On Fri, 28 Feb 2003 11:42:15 -0000, "Jim Scullion"

Quote
<jimscull...@hotmail.com> wrote:
>I'm running Virtual Pascal under Win 2K.  Program compiles OK, but when run
>ClrScr has no effect.  Can anyone help?

You might want to check with Allan directly, although I've noticed he
hasn't been answering emails as of late so I suspect that VP is
probably dead.  :-(  But you can email him at vpas...@vpascal.com

Regards,
Jim
(Cheap spam protection in place: remove the 'NoSpam'
from my email ID to reply to me personally)

Re:Problem with ClrScr in Virtual Pascal


Quote
In article <tp056v4bfbjpglmm36prtvqrfugb3ru...@4ax.com>, Jim Wilson wrote:
> On Fri, 28 Feb 2003 11:42:15 -0000, "Jim Scullion"
><jimscull...@hotmail.com> wrote:

>>I'm running Virtual Pascal under Win 2K.  Program compiles OK, but when run
>>ClrScr has no effect.  Can anyone help?

> You might want to check with Allan directly, although I've noticed he
> hasn't been answering emails as of late so I suspect that VP is
> probably dead.  :-(  But you can email him at vpas...@vpascal.com

I also think it is dead. No movement since late 2001, except one "VP isn't
dead" msg on the site.

Re:Problem with ClrScr in Virtual Pascal


Quote
"Jim Scullion" <jimscull...@hotmail.com> wrote in message <news:b3nhrl$5hu$1@phys-pa.scotland.net>...
> I'm running Virtual Pascal under Win 2K.  Program compiles OK, but when run
> ClrScr has no effect.  Can anyone help?

> Thanks in advance.

Hi,

I've been using Virtual Pascal under W2K for quite some time without
any problems.   Only bug I've found is that the SameText function is
broken (use CompareText instead).

Check out the VP mailing list, there's still a few experts{*word*154}
around on it who can possibly help.

Do you have a more specific example?

Thanks,
Paul

Re:Problem with ClrScr in Virtual Pascal


Here's a simple example where VP just ignores ClrScr.  It works fine in both
FP and Turbo Pascal.  It's a real shame, because otherwise I'm very
impressed by VP, particularly the IDE.

program user_menu;
uses Crt;
var menu_choice:integer;

procedure initialise;
begin
menu_choice:=0;
end;

procedure display_menu;
begin
ClrScr;
writeln('User Menu');
writeln;
writeln;
writeln('First Menu Item           (1)');
writeln;
writeln('Second Menu Item          (2)');
writeln;
writeln('Quit                      (3)');
writeln;
writeln;
writeln;
writeln('Enter the number corresponding to your chosen item');
writeln;
readln(menu_choice);
end;

procedure process_item_one;
begin
ClrScr;
writeln('You heve chosen item one');
writeln;
writeln;
writeln('Press enter to return to the main menu screen');
readln;
end;

procedure process_item_two;
begin
ClrScr;
writeln('You have chosen item two');
writeln;
writeln;
writeln('Press enter to return to the main menu screen');
readln;
end;

procedure get_choice;
begin
if menu_choice= 1 then
        process_item_one
else
if menu_choice=2 then
        process_item_two;
end;

begin
repeat
        display_menu;
        get_choice;
until menu_choice = 3
end.

Quote
"Paul Hartman" <b...@arabia.com> wrote in message

news:19d67f8a.0303051306.638509ea@posting.google.com...
Quote
> "Jim Scullion" <jimscull...@hotmail.com> wrote in message

<news:b3nhrl$5hu$1@phys-pa.scotland.net>...
Quote
> > I'm running Virtual Pascal under Win 2K.  Program compiles OK, but when
run
> > ClrScr has no effect.  Can anyone help?

> > Thanks in advance.

> Hi,

> I've been using Virtual Pascal under W2K for quite some time without
> any problems.   Only bug I've found is that the SameText function is
> broken (use CompareText instead).

> Check out the VP mailing list, there's still a few experts{*word*154}
> around on it who can possibly help.

> Do you have a more specific example?

> Thanks,
> Paul

Re:Problem with ClrScr in Virtual Pascal


VP 2.1 compiles and runs your program perfectly with one change.

uses Crt, Use32;

Regards, Jim

Quote
Jim Scullion wrote:
> Here's a simple example where VP just ignores ClrScr.  It works fine in both
> FP and Turbo Pascal.  It's a real shame, because otherwise I'm very
> impressed by VP, particularly the IDE.

> program user_menu;
> uses Crt;
> var menu_choice:integer;

> procedure initialise;
> begin
> menu_choice:=0;
> end;

> procedure display_menu;
> begin
> ClrScr;
> writeln('User Menu');
> writeln;
> writeln;
> writeln('First Menu Item           (1)');
> writeln;
> writeln('Second Menu Item          (2)');
> writeln;
> writeln('Quit                      (3)');
> writeln;
> writeln;
> writeln;
> writeln('Enter the number corresponding to your chosen item');
> writeln;
> readln(menu_choice);
> end;

> procedure process_item_one;
> begin
> ClrScr;
> writeln('You heve chosen item one');
> writeln;
> writeln;
> writeln('Press enter to return to the main menu screen');
> readln;
> end;

> procedure process_item_two;
> begin
> ClrScr;
> writeln('You have chosen item two');
> writeln;
> writeln;
> writeln('Press enter to return to the main menu screen');
> readln;
> end;

> procedure get_choice;
> begin
> if menu_choice= 1 then
>         process_item_one
> else
> if menu_choice=2 then
>         process_item_two;
> end;

> begin
> repeat
>         display_menu;
>         get_choice;
> until menu_choice = 3
> end.

Re:Problem with ClrScr in Virtual Pascal


In fact, I just tried it without "use32" and everything still works just
fine. What problem are you having?

I do notice that your program freezes if the input from ReadLn is the
wrong type. If you used ReadKey to read in ASCII characters from the
keyboard, you could check for correct input easier and prompt the user
for correct input.

Regards, Jim

Quote
Jim Van Scoy wrote:
> VP 2.1 compiles and runs your program perfectly with one change.

> uses Crt, Use32;

> Regards, Jim

> Jim Scullion wrote:

>> Here's a simple example where VP just ignores ClrScr.  It works fine
>> in both
>> FP and Turbo Pascal.  It's a real shame, because otherwise I'm very
>> impressed by VP, particularly the IDE.

>> program user_menu;
>> uses Crt;
>> var menu_choice:integer;

>> procedure initialise;
>> begin
>> menu_choice:=0;
>> end;

>> procedure display_menu;
>> begin
>> ClrScr;
>> writeln('User Menu');
>> writeln;
>> writeln;
>> writeln('First Menu Item           (1)');
>> writeln;
>> writeln('Second Menu Item          (2)');
>> writeln;
>> writeln('Quit                      (3)');
>> writeln;
>> writeln;
>> writeln;
>> writeln('Enter the number corresponding to your chosen item');
>> writeln;
>> readln(menu_choice);
>> end;

>> procedure process_item_one;
>> begin
>> ClrScr;
>> writeln('You heve chosen item one');
>> writeln;
>> writeln;
>> writeln('Press enter to return to the main menu screen');
>> readln;
>> end;

>> procedure process_item_two;
>> begin
>> ClrScr;
>> writeln('You have chosen item two');
>> writeln;
>> writeln;
>> writeln('Press enter to return to the main menu screen');
>> readln;
>> end;

>> procedure get_choice;
>> begin
>> if menu_choice= 1 then
>>         process_item_one
>> else
>> if menu_choice=2 then
>>         process_item_two;
>> end;

>> begin
>> repeat
>>         display_menu;
>>         get_choice;
>> until menu_choice = 3
>> end.

Re:Problem with ClrScr in Virtual Pascal


Quote
"Jim Scullion" <jimscull...@hotmail.com> wrote in message <news:b4794e$t28$1@phys-pa.scotland.net>...
> Here's a simple example where VP just ignores ClrScr.  It works fine in both
> FP and Turbo Pascal.  It's a real shame, because otherwise I'm very
> impressed by VP, particularly the IDE.

I just tried it, and it worked correctly for me. I'm using Virtual
Pascal 2.1 on Windows 2000. I use clrscr & lots of the other CRT unit
stuff (window, etc) all the time and havn't ever ran into the problem
you're experiencing.

Have you tried compiling from the command line vs. compiling from the
IDE?

All I can think of is to maybe reinstall VP (or check the current
installation to be sure nothing is going wrong). Or perhaps try to
rebuild the RTL and system lib's (look in the c:\vp21 directory tree
for some batch files).

I've been using it for a couple years and have been able to generate
working Win32, OS/2 and DOS exe's with "virtually" no problems.

thanks,
Paul

Re:Problem with ClrScr in Virtual Pascal


I've been using my laptop, but after the postings from you and Jim Van Scoy
I tried a Win 2K desktop computer.  The problem didn't occur!

So now I'm really pleased that it's not a VP bug, but completely at a loss
in terms of what's wrong with my laptop configuration to cause such a weird
condition.

Thanks to all of you for your input.  I really appreciate it.

Quote
"Paul Hartman" <b...@arabia.com> wrote in message

news:19d67f8a.0303061200.3c9e372a@posting.google.com...
Quote
> "Jim Scullion" <jimscull...@hotmail.com> wrote in message

<news:b4794e$t28$1@phys-pa.scotland.net>...
Quote
> > Here's a simple example where VP just ignores ClrScr.  It works fine in
both
> > FP and Turbo Pascal.  It's a real shame, because otherwise I'm very
> > impressed by VP, particularly the IDE.

> I just tried it, and it worked correctly for me. I'm using Virtual
> Pascal 2.1 on Windows 2000. I use clrscr & lots of the other CRT unit
> stuff (window, etc) all the time and havn't ever ran into the problem
> you're experiencing.

> Have you tried compiling from the command line vs. compiling from the
> IDE?

> All I can think of is to maybe reinstall VP (or check the current
> installation to be sure nothing is going wrong). Or perhaps try to
> rebuild the RTL and system lib's (look in the c:\vp21 directory tree
> for some batch files).

> I've been using it for a couple years and have been able to generate
> working Win32, OS/2 and DOS exe's with "virtually" no problems.

> thanks,
> Paul

Re:Problem with ClrScr in Virtual Pascal


It may have something to do with how the DOS window or the Program
window is configured. Stuff like "Prevent DOS from recognizing Windows"
or "DOS Mode, etc.

Regards, Jim

Quote
Jim Scullion wrote:
> I've been using my laptop, but after the postings from you and Jim Van Scoy
> I tried a Win 2K desktop computer.  The problem didn't occur!

> So now I'm really pleased that it's not a VP bug, but completely at a loss
> in terms of what's wrong with my laptop configuration to cause such a weird
> condition.

> Thanks to all of you for your input.  I really appreciate it.
> "Paul Hartman" <b...@arabia.com> wrote in message
> news:19d67f8a.0303061200.3c9e372a@posting.google.com...

Other Threads