* * *

Author Topic: [Solved] Runtime Error 103  (Read 5677 times)

Logic_Bomb

  • New member
  • *
  • Posts: 41
[Solved] Runtime Error 103
« on: August 29, 2011, 05:59:56 am »
I have been using Lazarus & ObjPascal/Delphi for a while now and this is by far the most confusing problem I have had... I have been making a simple application to teach my friend (Who is new to ObjPascal) the basics, and it seems that I myself am having issues with the basics... He has compiles & run the same code as I am and it works fine for him, which raises the question, what's gone wrong? This code has worked fine for me in the past and is only a simple 'Hello World' application, running the following:

Code: [Select]
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { you can add units after this };

{$R *.res}

begin
  Writeln('Hi');
  Readln();
end.

Throws up no debug messages but a run-time message that says the following:
Code: [Select]
"Project project1.exe raised exception class 'RunError(103)'."
The IDE then points to this line:
Code: [Select]
Writeln('Hi');
and Upon hovering over the line gives this message:
Code: [Select]
"Writeln = No Symbol \"Writeln\" in current context."
If I then try and run the .EXE I get the following Error:
Code: [Select]
"An unhandled exception occurred at $0040151B :
EInOutError : File not open
$0050151B Line 15 of project1.lpr"

I am utterly baffled. as my friend can run the code with no problems and yet my IDE will run other applications fine, but refuses to run newly created console applications...

Lazarus Info:
 - Version: 0.9.30
 - Date: 2011-03-08
 - FCP Version: 2.4.2
 - SVN Revision: 29749
 - i386-win32-win32/win64

Any help would be greatly appreciated and if any of my spelling or grammar is incorrect please exuse - it is early hours of the morning and i'm kinda frustrated with this! xD

Thanks.

Logic~
« Last Edit: August 29, 2011, 06:58:36 am by Logic_Bomb »

Leledumbo

  • Hero Member
  • *****
  • Posts: 5231
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Runtime Error 103
« Reply #1 on: August 29, 2011, 06:50:24 am »
Ensure you don't check -WG (GUI application) in compiler option, that would close standard output. WriteLn (by default) writes to standard output.

Logic_Bomb

  • New member
  • *
  • Posts: 41
Re: Runtime Error 103
« Reply #2 on: August 29, 2011, 06:58:23 am »
Ensure you don't check -WG (GUI application) in compiler option, that would close standard output. WriteLn (by default) writes to standard output.

You sir, are a saviour! And i'm an idiot!! xD Completely missed that in the compiler options, Didn't cross my mind that it'd be as simple as that!!!

Thanks alot, Really, really appreciated!!! =)

Logic~

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads