Results 1 to 5 of 5

Thread: Value parameters won't compile?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    No it's in objfpc mode
    Code:
    program Project1;
    
    {$mode objfpc}{$H+}
    
    Const
      MyConst = 20;
    
    Procedure MyRealFunc(I : Integer = MyConst);
    begin
      Writeln('Function received : ',I);
    end;
    
    begin
      MyRealFunc;
    end.
    But like said i don't know what i'm doing wrong, because the app doesn't run even if i do this:
    Code:
    program Project1;
    
    {$mode objfpc}{$H+}
    
    Procedure MyRealFunc;
    var i: integer;
    begin
      i:=1;
      Writeln('Function received : ',i);
    end;
    
    begin
      MyRealFunc;
    end.
    Compiler messages are real though, wrong changes in code do result in errors.

    edit: AH! Now they run. I disabled -WG from project options so that it doesn't try to make it Win32 GUI application. From command prompt i get:
    Code:
    Function received : 20
    Last edited by User137; 23-08-2011 at 02:07 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •