Problems getting started [SOLVED] lazarus / 21-General ---------------------------------------------------------------------- DaveP · 2022-05-25 11:40 Hi,  I am trying to convert some DOS Modula-2 programs I wrote in the 90's with the Topspeed M2 Compiler. Running PC-Linux, and using Lazarus with the crt library for the applications and libraries. I have added a few lines from the crt library to a simple example programme which compiles Ok. But I tried adding a procedure to an example library and it fails to compile with the following message. Compile project1 Target: libproject1.so: Exit code1, Errors: 1  Project1.pas(31.3) Fatal: Syntax error, "BEGIN" expected but "identifier COLORS" found Code: [Select]library subs; uses   crt;     // crt added to example. procedure Colors( FgCol, BgCol : Byte );    // Added this procedure   begin     TextColor( FgCol );     TextBackground( BgCol );   end; function SubStr(CString: PChar;FromPos,ToPos: Longint): PChar; cdecl;    // Existing example follows.  //  This is an copied example, var   Length: Integer; begin   Length := StrLen(CString);   SubStr := CString + Length;   if (FromPos > 0) and (ToPos >= FromPos) then   begin     if Length >= FromPos then       SubStr := CString + FromPos;     if Length > ToPos then     CString[ToPos+1] := #0;   end; end; project1 exports   SubStr;   Colors; end.                                I don't understand why this fails, but if armed with a simple working library I think I can make some progress towards converting the first program. ---------------------------------------------------------------------- marcov · 2022-05-25 12:19 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i project1   // remove this   exports  SubStr;   // exports expects a list separated by commas, terminated with semcolon. So  exports substr,  colors;  not substr;colors;   Colors;end. ---------------------------------------------------------------------- Red_prig · 2022-05-25 12:19 Quote//project1 exports   SubStr;   Colors; end.  the project1 line is not needed here ---------------------------------------------------------------------- DaveP · 2022-05-25 13:42 Many thanks for the replies.  Now compiles Ok.  I can now get on with expanding the simple code bits into something useful, and on to another problem I guess. DaveP.. ---------------------------------------------------------------------- MarkMLl · 2022-05-25 14:04 Subject to Marco's confirmation, but I'd suggest not trying to mix the Crt library etc. with GUI-oriented application programming. Apart from that I don't think you'll have too many problems unless your code has coroutines (including interrupt handlers) although you will obviously need to watch out for the "dangling else" problem. MarkMLl