Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

fpconsole

Tool for running Pascal codes directly from console. (REPL-like)

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

FPConsole FPConsole

Debug tool for Pascal Developer

This debug tool helps you directly write input and get output in Free Pascal Compiler without writing a new file.

Note: FPConsole requires Free Pascal Compiler installed on the system. Download here

Instructions:

These instructions are available in latest version ( v1.5.1 ). For old version, checkout wiki page for proper parameter.

Simple Execute

fpconsole [command]

  • Command Prompt : fpconsole [command]
batch
C:\> fpconsole "write('Hello World');"
  • Powershell : .\fpconsole [command]
powershell
PS C:\> .\fpconsole "write('Hello World');"
  • Linux Terminal : ./fpconsole [command]
bash
$ ./fpconsole "write('Hello World');"

Advanced Execute

  • Execute With Custom Parameter

fpconsole [Code] [Parameter]

  • Get Code From a Text File

fpconsole -f [File Include Code] [Parameter]

  • Edit Source File Before Compiling

fpconsole -fe [Parameter]

  • ...or Get The Whole Source Code

fpconsole -fs [Source Code File] [Parameter]

Example

powershell
PS C:\> .\fpconsole "write('Hello World')" "-e" "Hello"
# This will execute with parameter "-e" and "Hello"

PS C:\> .\fpconsole -f "Code.dat"
# This will read main program from "Code.dat"

PS C:\> .\fpconsole -fe
# This will open notepad/nano to edit

PS C:\> .\fpconsole -fs "Code.pas"
# This will copy "Code.pas" then compile

(Optional Files)

  • Add UNIT to _unit.dat
pascal
sysutils,
graph,
...
  • Add TYPE to _type.dat
pascal
Int = -128..128;
a = array[1..100] of integer;
...
  • Add CONST to _const.dat
pascal
s = 'Hello';
pi = 3.14;
...
  • Add VAR to _var.dat
pascal
s: string;
i,j,m,n: integer;
...

Project's Website

Changelog

Version 1.5.1

  • Fix SysFind(); function not working properly
  • Add icon

Version 1.5

  • Open defualt editor to edit source before compiling (-fe) (#13)
  • Add execution time (#11)
  • Code now can execute with custom parameters
  • Add color
  • Change Input Folder:
Old File Name New File Name
unit.dat _unit.dat
var.dat _var.dat
const.dat _const.dat
type.dat _type.dat

Version 1.3

  • Add support for Linux
  • Fix #5

Version 1.2.2 Build 170326

  • Change Work Folder to %TEMP%.
  • Add Help (-h), Clear (-c), Read Source (-fs).

Version 1.1 Build 170228

  • Automatic Find FPC Directory.

Version 1.0.1 Build 170227

  • Fix Directory.

Version 1.0 Build 170226

  • First Release.

License

MIT License (c) Nguyễn Tuấn Dũng (@winux8yt3)