Virtual Pascal

Classic Object Pascal for free

Hello friends, Can somebody help me with the following? Forgive me if my remarks are naive, I am really very ignorant about programming.

I've been using VP on my home computer for several years. However, the truth is that although I manage to get by, I still have various problems in using VP. I won't go into these now (later perhaps), but will explain my current problem.

Recently I downloaded VP onto my computer at work. The trouble is that the programs I wrote and use at home no longer work. For example, I get a compiler error that CLRSCR is an unknown identifier. I thought that adding CRT under USES might help, but then all I get is CRT.VPI IS NOT FOUND. It looks as though the package I downloaded is incomplete. Can anyone tell me what I must do to overcome this problem?

Many thanks, Lee

Views: 377

Reply to This

Replies to This Discussion

Hi !

Did you check the default directories ?
Or maybe you need to recompile the RTL. I'm at work so I don't have VP available but ik think there is a BUILDRTL.PAS (or a name like that) in the sources.

Bye for now,
Alcatiz.
Hi Alcatis,
Thanks for your response. I find 4 files in VP21\Source\Rtl that resemble your suggestion:
Bldrtl.1
Bldrtl.cmd
Bldrtl.ORG
Bldrtl.pas

I've tried clicking on these but nothing seems to happen. Can you suggest something I could try?

Regards, Lee
Hi

You can load bldrtl.pas in the editor and then select Compile -> Build.
If you intend to use the OWL (Object Windows Library) you can do the same with \owl\buildowl.pas.

Hope this helps you ?
Ok, thanks. I tried that and got Success. But it makes no difference: clrscr is still an unknown identifier.
As for your second point, there exists no file or folder in the VP21 folder containing the trigram OWL.
Any further ideas welcome.
Correction! I forgot to add the crt unit. Everything works fine now. Many thanks Alcatis, I really am grateful. But now I have a second question.

Formerly, when I used Borland Pascal, I could halt a running program simply by hitting the Pause key. This no longer works with VP. How do I stop/restart a running program?
I'm glad it works now :)

I'm not sure I correctly understand your question : do you mean you want to stop the execution of a program during a debugging session ? If this is your purpose, you can add breakpoints in your program using Ctrl-F8 in the VP editor and then run your program with Ctrl-F9.
I've had trouble explaining this problem to others, which suggests I'm doing things in an unconventional way. Here's what I do.

Most of my programs examine large numbers of combinations (of integers, say) in search of special cases possessing special properties. As the latter are found they are written on screen (using writeln) in the VP debugging window one after the other. Starting the program using Ctrl F9, I may therefore have to wait a long time before anything appears on screen, hours or even days, say. That is, solutions (ie the special cases) may be sparse, or may not even exist.

On the other hand, there may be a glut, whereupon solution after solution pours out so fast that they cannot be read properly on screen This is especially the case during the process of debugging the program when many apparent solutions may in fact be false due to a bug. At this point it is dead handy to be able to freeze execution with the Pause key so as to examine the screen at leisure, and then (when perhaps more info is required) hit it again in order to continue. (Perhaps I should add that my programs generally end with repeat until keypressed so as to keep the VP debugging window visible after the program is finished.)

The trouble is that I can't seem to pause in this way with VP. And every time I ask, How do I interrupt execution? I get raised eyebrows.

Of course, an obvious solution to all this is to have the program write its results to a file instead of screen. And that is exactly what I do, or rather, what I have been forced to do since using VP. But look how much to-ing and fro-ing between files that entails everytime I make some adjustment to the program and then want to see what the effect has been. And oh how I miss the convenience of the Pause key when I worked with Borland (and from which I changed only because VP offered me the large array sizes I cannot do without).

Any comments gratefully received. Lee
Hi !

Well you can use Mark Russinovich's Process Explorer utility (which can be also used as a replacement for the Windows Task Manager) to suspend and resume your program (right click on the process in the list then Suspend or Resume).

Here is a link to download this *free* and *very powerful* and *recommended by Microsoft* utility : http://technet.microsoft.com/fr-be/sysinternals/bb896653(en-us).aspx

I've tried to suspend and resume a program (run within VP or run within the console) : it works.
Hi, sorry for the delay, I've been ill (still am).

Thanks again for the suggestion. But is downloading this utility merely in order to halt a pascal program really the right way to go? I mean, it just seems like using a sledge hammer to crack a nut.

But what beats me is why I seem to be alone in missing a Pause key. Why is it that others don't share my frustration? And why does BP provide it if nobody needs it? Granted that I am an ignoramus who is probably doing things incorrectly, what is it I ought to be doing? In a previous mail I tried to explain why the ability to pause is needed. Can you explain to me what is wrong with my approach?
Hi !

I had never heard of the pause feature in BP and I think I've never really needed it because when I have to pause a program it is only during the debugging session.

I don't think your approach is wrong but I think the pause feature simply doesn't exist in the Windows console, in which VP runs the program.
For the same reason it is also impossible to pause a program run by Free Pascal (I've also tried).
BP and the program you run within it (so 16-bit programs) run in a virtual DOS machine (NTVDM) : the pause key is emulated by the virtual machine.
I think the difference is precisely there.
Hi Alcatis,

I enter these comments in response to yours of Dec 21 because the expected "Reply to This" prompt has failed to appear below your latest sending, for which again , my sincere thanks. I understand what you say about the Pause key being emulated in the virtual machine. So it seems I shall simply have to live with this problem. Meanwhile, if you can stand it, I would like to ask about another point.

Although not really a problem, I am baffled by the visual appearance of the VP Editor on my screen. Have I perhaps failed to implement the program properly or is what I see the same as everyone does? I refer here to the relatively crude, even primitive appearance of the lumpish characters, reminiscent as they are of what we were used to seeing on our computer screens with the technology of 20 or more years ago. At least, opening the same file of code using a word processor such as MS Word, now at last I see the text as I would have expected in the first place: neat crisp characters on a white background, just as in the Borland editor, say. Is there some way to improve on this? Am I doing something wrong?
Hi !

First of all, I wish you a happy new year !

I think we have reached the maximum level depth of the thread...

The VP editor has indeed an old-fashioned look but I think it is really powerful. The macro concept, for example, didn't exist in the BP editor. And the integrated debugger also works fine with the IDE.

I've already tried third-party editors, such as ConText. The WYSIWYG look is more comfortable but every time there were some lacks and I came back to the original editor. I think I remember that Allan Mertner intended to create (in 2004 ou 2005) a VP plugin for Eclipse but it still doesn't exist.

For more comfort, I configured the VP editor to fit better the screen (more columns and more lines) this way :

1. Check "Keep original" in Options --> Environment -> Preferences

2. Save this setting : Options --> Save options.

3. Create a script called (why not) VP.cmd :
@Echo off
C:
CD \WINNT\System32
MODE CON COLS=132 LINES=70
C:
CD \Program Files\Vp21\Bin.w32
VP


4. Make a shortcut to this script

5. Edit the shortcut options :
- Display options : window
- Cursor size : middle
- Edit options : uncheck all (to enable full mouse functionality)

6. Control panel --> Keyboard --> Cursor blinking : select a fast speed

But if you find the perfect WYSIWYG editor for VP please let me know :)

RSS

© 2020   Created by Allan Mertner.   Powered by

Report an Issue  |  Terms of Service