Recent

Author Topic: execute free pascal code (SOLVED)  (Read 3535 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
execute free pascal code (SOLVED)
« on: January 16, 2012, 02:45:47 pm »
how can I eseeguire free pascal code passed as input to an executable? can you do?
« Last Edit: January 16, 2012, 04:35:13 pm by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: execute free pascal code
« Reply #1 on: January 16, 2012, 03:35:25 pm »
Way 1:
Create temporary file with that code and call the compiler to compile this file, and if successful, execute it.

Way 2:
Embed a Pascal interpreter capable of executing the language subset you want (AFAIK currently no interpreter implements all Object Pascal constructs, esp. those which are specific to Free Pascal).

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: execute free pascal code
« Reply #2 on: January 16, 2012, 03:38:00 pm »
PascalScript you think a solution can be trusted?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: execute free pascal code
« Reply #3 on: January 16, 2012, 03:39:48 pm »
Quote
PascalScript you think a solution can be trusted?
For me, yes.

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: execute free pascal code
« Reply #4 on: January 16, 2012, 03:48:22 pm »
Thank you
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: execute free pascal code
« Reply #5 on: January 16, 2012, 04:35:01 pm »
Solved with this:

PascalScript
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018