I wanted to build and run Pascal in Sublime Text 2 (or 3). I've searched as much as I could and although I could get sublime to BUILD my dpr or pas files in ST3, I struggle with getting them to run as an exe in command prompt. Therefore, I tried using this, as someone suggested (Qwerty answered this question on someone else's post):
{
"cmd": ["fpc", "${file_path}/${file_base_name}"],
"selector": "source.pascal",
"variants": [
{
"cmd": ["start", "cmd", "/c", "$file_base_name.exe & pause"],
"name": "Run",
"shell": true
}
]
}
It works perfectly fine when compiling and running hello world, but gives me errors with everything else:
Free Pascal Compiler version 2.6.4 [2014/03/06] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling F:\Ali\Pascal\Projects\adult.pas
Linking F:\Ali\Pascal\Projects\adult.exe
adult.pas(32,1) Error: Can't create object file: F:\Ali\Pascal\Projects\adult.exe
adult.pas(32,1) Fatal: Can't create executable F:\Ali\Pascal\Projects\adult.exe
Fatal: Compilation aborted
Error: C:\FPC\2.6.4\bin\i386-Win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)
[Finished in 0.4s with exit code 1]
Whereas if it's Hello World:
Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling F:\Ali\Pascal\Projects\hello.pas Linking F:\Ali\Pascal\Projects\hello.exe 4 lines compiled, 0.3 sec , 25936 bytes code, 1644 bytes data [Finished in 0.5s]