Recent

Author Topic: Change old cods from turbo pascal into free pascal  (Read 20842 times)

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Change old cods from turbo pascal into free pascal
« Reply #15 on: February 21, 2017, 04:37:53 pm »
I am weird like that. :)
Sometimes I enjoy running WordPerfect 5.1, Turbo Pascal 7 and other goodies from the past on my modern machine. 8)

It's 2017, so we can do that easily.
People are also into pixel graphics again, like it was the 80's.
« Last Edit: February 21, 2017, 04:39:41 pm by jacmoe »
more signal - less noise

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change old cods from turbo pascal into free pascal
« Reply #16 on: February 21, 2017, 04:46:19 pm »
And that's no problem jacmoe. I understand that.

I was making the remark with regards of the context of OP's question. TP 5.5. did not had any notion of long file names, so why make things more difficult for OP then they already are ?

And that is without any negativity towards vdosplus. Just run whatever works for you (as i already made that hint in on of my previous posts, in that regards your link will aid OP in finding a suitable emulator).

fiwiw: as Thaddy mentioned, taking a shot with using FreeVision is also possible. But i'm anticipating that this will also take time for OP. Emulation is the fastest way to keep things running (if possible). The last remarks from OP seems to suggest he/she want to port to LCL. It might be worth it, but i do not know the importance of the software that OP is attempting to port.

PS: i'm still hunky dory using my Amiga... so you're barking up the wrong tree there ;-) Have a look at aros in case you're really bored and have nothing todo  :)
« Last Edit: February 21, 2017, 04:52:37 pm by molly »

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Change old cods from turbo pascal into free pascal
« Reply #17 on: February 21, 2017, 04:54:02 pm »
My guess is that TP7 can handle TP5.5 code, that's why I recommended that, but maybe I'm wrong?

WordPerfect5.1 didn't have any notion of long filenames either, but I am using long filenames with it (with Dosemu) just fine. ;)
No, I am not. 'thisisatestofalongfilename.doc' becomes 'thisisat.doc' ... But that's beside the point ;)

But, yes: if it's possible to use something modern, like Lazarus or FP, then it would be better.
« Last Edit: February 21, 2017, 05:07:47 pm by jacmoe »
more signal - less noise

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change old cods from turbo pascal into free pascal
« Reply #18 on: February 21, 2017, 05:10:12 pm »
My guess is that TP7 can handle TP5.5 code, that's why I recommended that, but maybe I'm wrong?
That should work but, in all honesty, i haven't used tp 5.5 in ages (can't even find my original copy that's somewhere around here), let alone tried the same code against 5.5 and 7.1.

edit:
Important factor: is all original source-code available ? If OP needs to compile against tpu files then the exact same compiler is to be used.
« Last Edit: February 21, 2017, 05:28:41 pm by molly »

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #19 on: February 21, 2017, 05:41:58 pm »
please can u more deitels about that
This is really not the place to ask for help about emulation.

Nonetheless, something like DosBox can be found here and it has it's own wiki here.

In case you do not fancy dosbox or wish to run an emulator on another host plaform (unsupported by dosbox) then just do a google search on "list of msdos emulators", take a pick and read the corresponding documentation.

The basics are the same.
1 - Install the emulator on your machine
2 - configure your emulator
3 - install ms dos or equivalent
4 - install your old turbo pascal program
5 - run your old Pascal program just as you would have done on a real ms-dos machine

With regards to virtualization software, you could follow a guide such as listed here.

If you are able to run your old software this way without any issues then you just bought yourself time.



You could then use that time to start doing an inventory on what your old program uses, e.g. what kind of screens, windows, editboxes etc are used and which match those from Lazarus.

You said that your program has more than 100000 lines of code but, in turbo vision you almost had to modify every existing object manually to accommodate your needs.

Even though this is also true for the 'matching' components in Lazarus, most of the component in Lazarus are much more flexible and offer most functionality out of the box (or with little programming effort).

However, porting your old turbo vision application over to Lazarus is (and always will be) manual labour. There is no automated process that is able to help you there.

In case you have your 'working' code separated from your (Turbo Vision) gui then it is often quite possible that you are able to copy parts of your code. In case you have a tight integration with Turbo Vvision's GUI then you have a long road ahead of you.

Point being that there can't be anything said unless having seen the actual code. You really need to analyze and make an inventory about what would need to be ported or not.

In case you do not have any experience with Lazarus then i strongly suggest to start with playing with Lazarus instead of trying to port your code right away.

Only if you know what Lazarus can do _then_ you are able to tell what is required to port your old Turbo Vision application.

just 2 cents.




Thank you very much for the wide explaing
 
Programm is working in Windows 7 normaly
it is open a window as Dos format

but some Funktion do not work
print
maous
wenn i want to Exit from the window of Programm
i musst use alt+tab
i mean togther with other open window  from other Programm
i can not chang immededtily
 so my hope and wish is someway something
do with the progamm to give her new look and new Option
for exampel
print
mous funkation



In case you do not have any experience with Lazarus then i strongly suggest to start with playing with Lazarus instead of trying to port your code right away.

Only if you know what Lazarus can do _then_ you are able to tell what is required to port your old Turbo Vision application.



i hav enot so much experince with Lazarus
only some samle appliction i can do und small Programm
caculator
Form1
Listbox1
Button1
Edit1
Combobox1
Label1
Memo1
PaintBox1
Image1
MainMenu1

I look for the optimal saloution and way
to solve this Problem

i just did the window with Lazrus as old Programm

the main   qusation is
Mathematical equations
Can I just made using the copy and paste process
Or it should change my scripted formats in order to understand Lazarus
I mean secondary sections or subprograms Can I copy and paste
Or also must replace it to react with Lazarus uh FreePascal Copiler FPC





molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change old cods from turbo pascal into free pascal
« Reply #20 on: February 21, 2017, 05:54:21 pm »
Based on your responses (sorry i'm daft i could have read it from your code that was shown), i'm guessing that your native language is German.

Could you please repeat your response in your native tongue e.g. German ? There are some things you wrote that i have difficulty understanding.

Unfortunately i can only read German but not write it.

In case you feel more confident in your native tongue, then please feel free to elaborate as well.

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #21 on: February 22, 2017, 02:03:03 pm »
Based on your responses (sorry i'm daft i could have read it from your code that was shown), i'm guessing that your native language is German.

Could you please repeat your response in your native tongue e.g. German ? There are some things you wrote that i have difficulty understanding.

Unfortunately i can only read German but not write it.

In case you feel more confident in your native tongue, then please feel free to elaborate as well.

Vielen Dank für Ihre Kooperation und schnelle positive Reaktion sehr viel
Die Frage ist, dass:
Das Programm funktioniert auf meinem PC
Natürlich ist das Betriebssystem Windows 7
Um aktualisiert werden, um wie eine moderne Software zu suchen, wo es viele Arbeitsplätze, die nicht funktionieren, zum Beispiel,
1, zum Beispiel, wird der Drucker nicht funktioniert, dann meine ich die Drucker-Taste kann nicht Ergebnisse gedruckt werden
2 Grafiken Es gibt keine
Desktop, wie das alte System Turbo Pascal
Maus auch nicht funktioniert
Zum Schließen des Programms müssen mehrere Schritte folgen
Zuletzt in Englisch geschrieben EXIT
So fordern Sie eine von Maustasten müssen den Druck auf die Maustaste halten Sie die rechte Taste(ALT+TAB), um fordern
Wenn die Maus innerhalb des Programms ist, können Sie nicht etwas anderes im Fenster verwenden
Jeder sollte durch Drücken der beiden zusammen zarim aus dem Programmfenster sein


Die eine Form der mittelalterlichen wurde ich es sagen scherzhaft
Es ist ein weiterer Punkt
Es gibt mathematische Gleichungen im Programm
Sie könnten ihre Form behalten
Kein Kopieren Sie einfach einfügen, ohne die Art und Weise zu ändern scripted
Ist es dann wird das neue Programm in der Lage sein zu verstehen,
Oder sollten Sie die Formel in Turbo Pascal geschrieben ändern
Ich lese die Zeitungen und DOKUMENTEN Programm und wurde verwendet, DOC Genrator
PasDoc
Er las mir die Variablen und Werte und fixiert einige (Funktionieren )
PROZEDUR
Operationen
Also, was ist die beste Lösung in deiner Meinung
Vielen Dank für Ihr Verständnis
 
Mit freundlichen Grüßen

Благодарим Вас за сотрудничество и быстрый положительный ответ гораздо
Вопрос заключается в том, что:
Программа работает на моем компьютере
Конечно, операционная система Windows 7
Для того, чтобы обновить, чтобы выглядеть как современное программное обеспечение, где есть много рабочих мест, которые не работают, например,
1, например, принтер не работает, я имею в виду ключ принтер не может напечатать результаты
2 графика Там нет ни
Desktop как старой системе Turbo Pascal
Мышь не работает
Чтобы закрыть программу, ряд шагов, необходимо соблюдать
Последний написан на английском языке EXIT
Чтобы запросить одну из кнопок мыши имеют давление на кнопку мыши, удерживая правую кнопку (ALT + TAB) для вызова
При наведении курсора мыши в программе, вы не можете что-либо еще использовать в окне
Каждый человек должен быть из окна программы, нажав два вместе zarim


Одна из форм средневековой я был там в шутку говорят,
Существует еще одна точка
Существуют математические уравнения в программе
Они могли бы сохранить свою форму
Нет просто скопировать пасты, не меняя путь по сценарию
Является ли это новая программа будет в состоянии понять,
Или вы должны изменить написано в Turbo Pascal Формула
Я прочитал программу газеты и документы и использовали DOC Genrator
pasdoc
Он читал переменные и значения и фиксировали некоторые (функционирование)
ПРОЦЕДУРА
операции
Итак, что является лучшим решением по вашему мнению
Спасибо за ваше понимание




Thank you very much for your cooperation and quick positive response very much
The question is that:
The program works on my PC
Of course, the operating system is Windows 7
To be updated to look like a modern software, where there are many jobs that do not work, for example,
1, for example, the printer does not work, then I mean the printer button can not print results
2 graphics There are none
Desktop, such as the old system Turbo Pascal
Mouse also does not work
There are several steps to close the program
Last written in English EXIT
To request one of the mosaic keys, press the mute key to hold down the right key (ALT + TAB) to request
If the mouse is within the program, you can not use anything else in the window
Everyone should be by pressing the two together zarim from the program window


The one form of the medieval I was saying it jokingly
It is another point
There are mathematical equations in the program
They could keep their shape
No copy easy to paste without the way to change scripted
Is it then the new program will be able to understand,
Or you should change the formula written in Turbo Pascal
I read the papers and DOCUMENTS program and was used, DOC Genrator
PasDoc
He read me the variables and values ​​and fixed some (working)
PROCEDURE
Operations
So what is the best solution in your opinion
Thank you for your understanding





















Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Change old cods from turbo pascal into free pascal
« Reply #22 on: February 22, 2017, 02:08:24 pm »
Well, the printer is actually easy as long as you expect just old school prints:
Code: Pascal  [Select][+][-]
  1. program printme;
  2. uses printer;  // not printers here... printer. Without s . That contains LST and initializes it.
  3. begin
  4.   writeln(LST, 'print me');
  5. end.
All write/writeln formatting options are available, of course. As well as all the ASCII PRN control characters like linefeed, formfeed etc. Just dust them off.

A more modern look can be obtained by using the printers unit (here, with an s) and use AssignPrn. Examples are abundant on this forum.
« Last Edit: February 22, 2017, 02:16:02 pm by Thaddy »
Specialize a type, not a var.

Nitorami

  • Sr. Member
  • ****
  • Posts: 481
Re: Change old cods from turbo pascal into free pascal
« Reply #23 on: February 22, 2017, 08:37:02 pm »
This is not german either... the english is better. You are russian, right ? And did a google translate.

Of course you can keep the mathematical formulas written in Pascal. Why not ? FPC will understand them. The problem is only interfacing with a modern operating system, use of screen, mouse and printer.

I don't know what to say more on this. Run the program in an emulator. Even if it runs under windows 7 SOMEHOW, it will run much better with an emulator. Purpose of an emulator, in case you do not know, is to simulate another operating system, for instance DOS, on your Windows PC. Your program will think it is running on a DOS machine and should work as originally intended. The emulator should also make mouse, printers and graphics available to your program.
 
If it feels "medieval", well, then rewrite it using Lazarus. Keep the mathematical routines but re-write the rest. Just go ahead.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change old cods from turbo pascal into free pascal
« Reply #24 on: February 23, 2017, 12:06:44 am »
@Nokiarody:

First of all, i'm sorry for the delay. Real life kept me busy for longer then i anticipated.

I also apologize for having mistaken your native tongue for German  :-[

In that regards i agree with Nitorami that the German is even worse then the English. Therefor i will respond to the English parts only.

The program works on my PC
Of course, the operating system is Windows 7
To be updated to look like a modern software, where there are many jobs that do not work, for example,
1, for example, the printer does not work, then I mean the printer button can not print results
2 graphics There are none
Desktop, such as the old system Turbo Pascal
Mouse also does not work
There are several steps to close the program
Last written in English EXIT
To request one of the mosaic keys, press the mute key to hold down the right key (ALT + TAB) to request
If the mouse is within the program, you can not use anything else in the window
Everyone should be by pressing the two together zarim from the program window

Just like Nitorami wrote: Even if your old TP program is able to run on windows 7, then you are probably much better off running your program inside a real DOS emulator.

Such an emulator is especially designed to solve such issues as you described. Some emulators do a better job than other emulators but as noted by Thaddy (and in my own experience), DOS-box does a very good job for such old programs.

I really can't go deeper into the subject of emulation then this as it is already way out of scope for this forum.

Emulation is just an option for running your old software without the need to actually 'port' it.

Another option is to port your original sources and using Free Pascal + FreeVision but, in my opinion that time could also be spend to port your application using Lazarus and do a complete overhaul for the user interface from TUI (Text User Interface) to a real GUI (Graphical User Interface).

Quote
It is another point
There are mathematical equations in the program
They could keep their shape
No copy easy to paste without the way to change scripted
Is it then the new program will be able to understand,
Or you should change the formula written in Turbo Pascal
I read the papers and DOCUMENTS program and was used, DOC Genrator
PasDoc
He read me the variables and values ​​and fixed some (working)
PROCEDURE
Operations
So what is the best solution in your opinion
Thank you for your understanding

In case you have large portion of your code performing mathematical calculations then this should be no problem to copy over to Free Pascal.

As i wrote in my previous post: as long as there is not a tight integration with TurboVision's TUI, then it should be enough to copy over those mathematical procedures and functions to be used with Free Pascal. And in case you do encounter issues then you could always ask for help.

Again, there is no such program that will automatically convert your TurboVision TUI into a modern windows GUI. That can only be accomplished by doing manual labour.

In case you still want to use the TUI interface then the best you could try to do is to compile your sources against FreeVision TUI and see how far you will get.

Rewriting a TurboVision TUI over to Lazarus/LCL is something that requires a fair amount of time, and depends on your knowledge of Lazarus. As i already suggested in my previous post: First learn to use Lazarus/LCL before even attempt to port over your original TUI.

I can't give you any better advise then i already wrote in my previous post:
1. make your software run inside an emulator in order to buy yourself time
2. use that time to try to port your TUI over to Lazarus/LCL (this requires manual labour).

I would only opt for number 2 in case the software that you use is really worth the effort to port. Sometimes it simply is not worth the effort at all and, sometimes it is better to just do a complete rewrite of your original code.

So, basically i am telling you the same that Nitorami already wrote. I just used a few more words  :)

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #25 on: February 23, 2017, 07:15:25 am »
Thank  you very much for all
Personaly  thanks  for molly und Nitaromi
For your trying  to help me
January google tried  to help me in translation but I also think not very good always.
Speaking I can better  than writing (Russian  and Germany, Arabic, kurdish)
My native  language  is kurdish
I will try what you had me advice
When that succ6 that will very good
And I think
And u always here if I have some problems  with the project

Thank u very much for people like u

We keep in touch  OK    :)

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #26 on: May 24, 2017, 10:22:35 am »
Hi every body
I am sorry for the interruption I got my car accident
I've been in a coma because of the accident
Thank GOD I still a live
The other person was not lucky and died
The third person suffered only a small wound
that was destiny
But things are better now
I hope the concussion of the brain will not affect my absorptive abilities.
 :)

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #27 on: May 24, 2017, 10:37:50 am »
I return to our subject
During this period my friend succeeded in implementing the program through
Dosbox emulater
I am trying to delve deeper into Lazarus and FPC
I read different sources on the documentation or did not quite understand where exactly whati have to do.
What I did was
1-   what I need through the Lazarus
2-   Lazarus IDEV1.6.4>PROJECKT>NEW PROJECKT>CONSULARAPPLICATION
but what after  I don not know
I had the text from file (.pas) copy and paste into text editor of Lazarus and wrote  before
End.
Readln;
And after that just 
RUN
Then just one empty black quadrat opened   
Tell me what I'm doing wrong.

Then just one empty black quadrat opened   
Tell me what I'm doing wrong.
SO
Can you tell me what is hier is wrong and what I have to do


The scorned moment is
 I found in google that in FPC it is necessary to {tp mode}
And compiler it
I had to do that also but again  just black quadrate
Please try to tell me where the problem is?

Here I added some photo of the code and what happened   
Thankful in advance for your perception and understanding of an inexperienced person.



Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #28 on: May 24, 2017, 11:01:40 am »
here some photo

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #29 on: May 24, 2017, 11:02:53 am »
another one

 

TinyPortal © 2005-2018