Errors writting source code - Lazarus 1.6.4 lazarus / 32-Linux ---------------------------------------------------------------------- PsaCrypt · 2017-06-08 10:01 Hello to all members, recently I updated to Lazarus 1.6.4 and FPC 3.0.2, moving my source code from other programing language.  OS is Linux Mint 17.3.  I found next errors in Lazarus IDE: 1)  I can not create my own functions within IDE editor.  After added new module or form, created my own functions and compiling the project, compiler shows me error "expected end.".  Dot after end means end of program.  Within source code, function structure is a " begin ... end;" block.  IDE editor only allows me to create only one own function in new module or form.  Very sad.  :-( 2)  Lazarus IDE haves error in "save" and "save as ..." file options.  Error showed is about file access.  To create a new project and save it right, I only can do startlazarus, create new project, and push command button "save all".  This is the only way. Could be solved these errors? Thank you. ---------------------------------------------------------------------- Handoko · 2017-06-08 11:10 You said you recently updated your Lazarus/FPC. Do the issues happen on Lazarus 1.6.4 and FPC 3.0.2 only or also on other versions? ---------------------------------------------------------------------- jc99 · 2017-06-08 12:14 More Information please. What does your code look like ? What do you want it to look like ? Be verbose !! ---------------------------------------------------------------------- PsaCrypt · 2017-06-08 13:34 Hello Handoko, error number #2 is present in Lazarus 1.6 with FPC 3.0.  These errors are not founded in Delphi compiler IDE, but Delphi is Windows and I do not have that OS in my computers.  I love xBase compilers.  I found errors in stable release Harbour 3.0, losing variable values.  This is the reason I choose to move all my source code from Harbour and Delphi to FPC.  Edit added:  before Lazarus 1.6.4 I don't use Lazarus 1.6 for daily use, only used for testing some things.  Error number #1 was not tested in Lazarus 1.6. Jc99, error number #1 is found creating your own functions within a new module.  I don't have Lazarus/FPC in this device (Android).  Create new Lazarus project, add a empty source code module, declare functions like next sample ... Function myfunc1: boolean; Function myfunc2: boolean; Write some commands on these functions like next ... Function myfunc1(): boolean; Begin ... End; Function myfunc2(): boolean; Begin ... End; Save your project and try to compile it.  Compilation of myfunc1() success right, but compilation of myfunc2() returns error.  Expected "end." Instead of "end;". :-( ---------------------------------------------------------------------- Leledumbo · 2017-06-08 13:45 Your code contains syntax error, somewhere we can only guess. Your end; already exists somewhere, hence the parser is expecting end, which it doesn't then throw that error. ---------------------------------------------------------------------- sky_khan · 2017-06-08 14:04 #1 Most probably you have one or more extra "end;" than "begin"s in your source. #2 You should save your projects/units in a folder where you have full access rights like in your home or documents folder, depends on OS you use. ---------------------------------------------------------------------- Handoko · 2017-06-08 14:13 @PsaCrypt Lets try my step-by-step to start a new project, create new procedure and save: 01. Start your Lazarus. 02. Lazarus main menu > File > Close All. This step 02 is needed to make sure you 'really' start Lazarus fresh, not opening previous files. 03. Lazarus main menu > File > New > Project > Application > Press "OK" button. 04. On the Source Editor, move your caret (text cursor) to line #20, press Enter and then press Home. 05. Type "procedure SayHello;" and Enter. 06. Press ArrowUp, so now your caret should be on line #21. 07. Press Ctrl+Shift+C, now some codes will be appeared automatically. 08. You now should be on line #27. Type "ShowMessage('Hello');" 09. Lazarus main menu > Run > Compile. This process should not show any error or warning message. 10. Lazarus main menu > File > Save All > Provide a name (the default is Project1.lpi) > Choose the location you want > Press "Save" button. 11. It will then ask for the unit name (the default is unit1.pas). Rename it or use the default then press "Save" button. Try my steps above. If you manage to follow to step 11 without problem, then well done you have created a procedure (SayHello), compiled and saved them correctly. Creating functions are similar. ---------------------------------------------------------------------- PsaCrypt · 2017-06-08 15:01 Ufffffffffff ... sorry to all. I was wrong.  Error number #1 is solved.  I was converting a xBase funcion to Lazarus and forget to include "begin" in a "if...then" structure.  Now runs fine.  :-) Handoko, I started Lazarus fresh.  "Save all" command button is the only right way to save new project.  If you choose "file > save" or "file > save as ..." You got error accessing file. At this moment only error number #2 is present. Thank you.  :-) ---------------------------------------------------------------------- Handoko · 2017-06-08 15:30 I have no problem to use save as. Try these steps: 01. Start your Lazarus. 02. Lazarus main menu > File > Close All. 03. Lazarus main menu > File > New > Project > Application > Press "OK" button. 04. Lazarus main menu > File > Save As > Provide a name (the default is Project1.lpi) > Choose the location you want > Press "Save" button. 05. It will then ask for the unit name (the default is unit1.pas). Rename it or use the default then press "Save" button. Can you follow it to step 05 without error? Maybe the location you want to save to is protected, try to use other location. ---------------------------------------------------------------------- PsaCrypt · 2017-06-08 17:34 Steps 1 to 3 ok.  Step 4 error: access violation.  Choosed folder to save new application project is /home/mint, not restricted to read/write.  From terminal ... Tcustomformeditor.jitlistexception list.curreadstreamclass=nil nil Tapplication.handleexception: there was another exception during showing the first exception Stack trace: $0814b3e3 ... ... 15 more numbers to stack trace ... ... $08297d17 Lazarus.pp - unhandled exception ---------------------------------------------------------------------- Handoko · 2017-06-08 18:01 I heard some issues about Linux Mint + Lazarus in this forum. I didn't follow those threads, you can search for them if you want. I use Ubuntu Mate, I experience some minor issues only, none of them are critical. Perhaps you can install VirtualBox and try Lazarus on other Linux distros. The issue you got is a serious problem, it should receive more attentions. ---------------------------------------------------------------------- PsaCrypt · 2017-06-08 19:38 Handoko, before using Linux Mint I used Ubuntu.  I changed to Linux Mint Mate because system resources are more clean.  Ubuntu is changing like an old windows, too much memory.  My base plattform will be always i386 with 512mb, 1gb or 2gb RAM capacity.  This always run and have running all my software previously used in Ubuntu.  My Linux Mint is owned remaster.  :-)