Recent

Author Topic: How to load CSVDataset to DBGrid? CSV overwritten after first run.  (Read 5496 times)

Vodnik

  • Full Member
  • ***
  • Posts: 210
Re: How to load CSVDataset to DBGrid? CSV overwritten after first run.
« Reply #15 on: February 13, 2020, 09:35:17 pm »
No, the basic CSVDataset code belongs to FPC, not to Lazarus. Therefore, updating Lazarus is usless. Unfortunately, FPC 3.2 has not yet been released. Unless you want to build FPC from code you can download a precompiled snapshot from http://ftp.icm.edu.pl/packages/fpc/snapshot/.
Well, I downloaded the snapshot and tried to replace FPC 3.0.4 with FPC 3.2.0. This was the pain. I didn't find clear description how this should be done, so tried step by step correcting every error reported by Lazarus, until completely destroyed it. One who decide to walk this way should know in details how IDE works, that's not for me  :(

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: How to load CSVDataset to DBGrid? CSV overwritten after first run.
« Reply #16 on: February 13, 2020, 11:14:08 pm »
This is how I got it running on Windows (I don't know your OS):
Code: Bash  [Select][+][-]
  1. set DEST_DIR=d:\fpc320
  2. path %DEST_DIR%\bin\i386-win32\
  3. fpcmkcfg -d basepath=%DEST_DIR% -o %DEST_DIR%\bin\i386-win32\fpc.cfg
  • Open the Lazarus version for which you want to switch fpc to v3.2. But note that the current release 2.0.6 does not compile with fpc 3.2, you must use Lazarus fixes or trunk.
  • Go to "Tools" > "Options" > "Files.
  • Make the "compiler executable" point to the new location of fpc. In my case it is d:\fpc320\bin\i386-win32\fpc.exe
  • Make the "FPC Source directory" point to the folder which contains the "Packages" and "rtl" directories, in my case: d:\fpc320
  • Rebuild the IDE by going to "Tools" > "Configure Build Lazarus" ; in the "Clean-up" box check "Clean all" and "Switch after building to automatically". Click "Build"
  • After a while Lazarus restarts and will use fpc 3.2 now.

Of course, you can also install a new version with fpcupdeluxe which is less work.
« Last Edit: February 13, 2020, 11:29:55 pm by wp »

Vodnik

  • Full Member
  • ***
  • Posts: 210
Re: How to load CSVDataset to DBGrid? CSV overwritten after first run.
« Reply #17 on: February 14, 2020, 03:51:51 pm »
Thanks a lot, wp!
I nearly came to the same.
Lazarus also asks path to make.exe file, which doesn't come with snapshot.
I tried to use a one from FPC3.0.4, but this doesn't work:
Panic: make: Entering directory `C:/lazarus'
Panic: make: Leaving directory `C:/lazarus'
Panic: Makefile:29: *** You need the GNU utils package to use this Makefile.  Stop.

 

TinyPortal © 2005-2018