My bad, it only works when {$mode Delphi} is set. WISH they said that somewhere on said page No... they had to put it on the PREVIOUS page.
My bad, it only works when {$mode Delphi} is set. WISH they said that somewhere on said page No... they had to put it on the PREVIOUS page.
Last edited by deathshadow; 22-08-2011 at 11:31 AM.
The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure
Weird, it compiles for me perfectly fine.
Lazarus 0.9.31 , FPC 2.4.3, Win7 32bit
Maybe you're missing some compiler option if directly using fpc. Lazarus is inserting alot of them when compiling.
edit: Oops, actually it's giving RunError(103) when trying to run it. Stopping on the Writeln(
Last edited by User137; 22-08-2011 at 04:54 PM.
Lazarus throws it into delphi mode I believe, so it should compile. I can't wrap my head around RAD or visual programming, so I'm working from the command line... 30 years of programming including hand assembling my own machine language -- and I STILL can't grasp visual programming, the VCL, etc, etc... I could JUST barely understand OWL... VCL lost me...
If you cut/paste from the FPC website, it will bomb on the single quotes as for some screwed up reason, their code block has STYLED quotes instead of straights.
I'm coming to the conclusion the HTML version of the documentation is ***** USELESS!
The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure
No it's in objfpc mode
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+} Const MyConst = 20; Procedure MyRealFunc(I : Integer = MyConst); begin Writeln('Function received : ',I); end; begin MyRealFunc; end.
Compiler messages are real though, wrong changes in code do result in errors.Code:program Project1; {$mode objfpc}{$H+} Procedure MyRealFunc; var i: integer; begin i:=1; Writeln('Function received : ',i); end; begin MyRealFunc; end.
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