Recent

Author Topic: translator, from BASIC to PASCAL (source code translator)  (Read 8077 times)

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: translator, from BAS to PAS
« Reply #15 on: August 18, 2021, 06:38:24 pm »
These are my steps:
  • At the top of the file, add {$MODE TP}{$H-}
  • Compilation attempt --> For variable basic Error "Got Ansitring expected ShortString". Solution: basfile, pasfile are declared as AnsiString. Not sure, but I think this type does not exist in Turbo Pascal mode -> declare them as String
  • Next compilation attempt --> Error in FSplit(...): "String types have to match exactly in $V+ mode" --> Declare bPath, bName and bExt as String rather than String[100]
  • Next compilation attempt --> successful
I am attaching the modified file.

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BAS to PAS
« Reply #16 on: August 18, 2021, 07:48:45 pm »
Thanks!

now I have this error:



developer@Nitro-AN515-54:~/wip/MetOrbDet/BasPas$ ./bp TAYLOR.BAS
You compile TAYLOR.BAS with BasPas Version 0.602
Written by Andrea Tobian-Mezger 2003

Show also on:  http://groups.yahoo.com/group/BasPas
for informations and files

An unhandled exception occurred at $0000000000406505:
EInOutError: File not open
  $0000000000406505




juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BAS to PAS
« Reply #17 on: September 13, 2021, 05:25:21 am »
A kind reminder; I request help

af0815

  • Hero Member
  • *****
  • Posts: 1291
Re: translator, from BAS to PAS
« Reply #18 on: September 13, 2021, 07:29:46 am »
BTW: Your link to the group is not working.


Quote
EInOutError: File not open
Have you looked for the file, which is not open.
regards
Andreas

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BAS to PAS
« Reply #19 on: September 14, 2021, 05:37:57 am »
is correct, the group no longer exists!
the code was taken from here: https://www.exmortis.narod.ru/src_translate_eng.html/


regards, JUAN

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BAS to PAS
« Reply #20 on: April 18, 2022, 04:50:08 am »
Hi!

Here 2 original source code for the same objective: take a BASIC file and convert to PASCAL.
Please review and try to get working please  :o

regards, JUAN

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #21 on: April 18, 2022, 09:21:20 am »
Thank  you for sharing it.

Unfortunately I can't compile it using Lazarus 2.2.0. Got a compile-time error in ReplaceOutSBP function in bp.pas because it breaks the rule of immutable requirement. See the screenshot below and read the link:
https://wiki.freepascal.org/For#immutable_requirement

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #22 on: April 22, 2022, 12:38:23 am »
Thanks for answer...

regards, Juan

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #23 on: April 22, 2022, 08:23:44 am »
Thanks for answer...

regards, Juan
Never change the iteration-variable of a For-loop in code
Use Do While/Repeat Until
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #24 on: April 25, 2022, 02:43:18 am »
I cant understand well, you can compile it ?!
It works ?

regards, Juan

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #25 on: April 25, 2022, 07:11:37 am »
I cannot compile it. The error is in the line #188 in ReplaceOutSBP function in bp.pas. I tested it using Lazarus 2.2.0 FPC 3.2.2.

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: translator, from BASIC to PASCAL (source code translator)
« Reply #26 on: April 27, 2022, 01:38:06 am »
Thanks for answer.

 

TinyPortal © 2005-2018