Recent

Author Topic: SDF Dataset Multiline Usage and Other Questions  (Read 19298 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #15 on: September 15, 2012, 11:06:19 am »
Thanks, taazz, that explanation makes sense.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ericlaw02

  • Newbie
  • Posts: 3
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #16 on: September 15, 2012, 12:28:42 pm »
Alright, so it seems the error ended up to be the thing between the keyboard and the chair  :-[

I skimped out the procedure (or rather, not reading instructions and just did it through trial and error) and ended up just recompiling the component didn't recompile the whole IDE.

Reverted to taazz's original fixed code (I tried BigChimp's fix beforehand, but I forgot to report back), and AllowMultiLine seems to work properly in the IDE.

However, setting SdfDataSet.Active to true in IDE still popups "Unable to open file" for my existing application, however, it works perfectly when I try it in an new application.

So I tried adding an "Active = True" manually in the "object SdfDataSet1" portion of the project *.lfm, and it works. However, setting the "Active" property back to false in the IDE, and reopening Lazarus seems to have the problem again.

It seems Lazarus automatically deletes the "Active" property in the *.lfm file if it's false (because it's the default setting?), so I tried to add "Active = False" instead in the *.lfm file, and it seems to work normally. Lazarus also puts the "Active" property below the FieldDefs in the *.lfm file as well, if I set it to "True" in the IDE.

So I think Lazarus somehow freaks out now when the Active property isn't present in the *.lfm file? (or it could be an user issue again, but i'd hope not)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #17 on: September 15, 2012, 01:55:24 pm »
Another question is, is it possible to implement binary search in TSDFDataSet? As far as I know, TDataSet.Locate is broken, and it is necessary to build a locate/searching code manually, but so far I have only been able to write a simple linear search using TDataset First/Next/EOF commands.
While going through taazz's fixes I stumbled on this note in the original code:
Quote
12/Mar/04  Lazarus version (Sergey Smirnov AKA SSY)
      Locate and CheckString functions are removed because of Variant data type.
      Many things are changed for FPC/Lazarus compatibility.
As support for variants presumably has vastly improved since 2004, it may be possible to bring back the locate function... after looking for the original code ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #18 on: September 15, 2012, 02:01:53 pm »
However, setting SdfDataSet.Active to true in IDE still popups "Unable to open file" for my existing application, however, it works perfectly when I try it in an new application.

As far as I remember sdfDataset.FileMustExist controls this message. if the file does not exist in the specified path then when ever you activate the database and this property is true you will see that message. If the file do exist then there is something wrong with your path that trips up the IDE eg. spaces in the directory names, unicode characters, non english directory names are a coupld of things to look for.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #19 on: September 15, 2012, 02:12:15 pm »
Another question is, is it possible to implement binary search in TSDFDataSet? As far as I know, TDataSet.Locate is broken, and it is necessary to build a locate/searching code manually, but so far I have only been able to write a simple linear search using TDataset First/Next/EOF commands.
While going through taazz's fixes I stumbled on this note in the original code:
Quote
12/Mar/04  Lazarus version (Sergey Smirnov AKA SSY)
      Locate and CheckString functions are removed because of Variant data type.
      Many things are changed for FPC/Lazarus compatibility.
As support for variants presumably has vastly improved since 2004, it may be possible to bring back the locate function... after looking for the original code ;)
depends what are the problems that variants introduced, are they support type of problems eg variants behave differently on various operating systems and CPUs(endianes of numbers etc)? or where they simple speed, data type problems? Of course that comment says nothing on why it had to be done so we have to get some kind of history before actually start looking for the code or ways to implement this.

On a side note does SDF supprot indexing or sorting at all? and Which is the branch that holds the v1.0 release for lazarus and FPC? any one has managed to get a stable behavior from the debugger yet? On one time I can step in to lcl code with no problem the next minute there are no debug information no bullets to see on the lcl code no break points working in it etc but everything works on my application.

Rand mode off.

sorry about that had to vent.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #20 on: September 15, 2012, 02:33:26 pm »
OT: taazz, I'm going to open a new topic on your code. My test code is probably to rough for it...

Which is the branch that holds the v1.0 release for lazarus and FPC? any one has managed to get a stable behavior from the debugger yet?
Lazarus 1.0
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_0/
is released with FPC 2.6.0
http://svn.freepascal.org/svn/fpc/tags/release_2_6_0/
However, you may want to look into FPC 2.6 fixes (fixes from trunk are regularly backported there) and Lazarus SVN - that seems stable enough and gets a lot of bugfixes.
You can use e.g. fpcup to get that by default.
Otherwise, you could presumably use Lazarus 1.0 fixes http://svn.freepascal.org/svn/lazarus/branches/fixes_1_0/ though I haven't used it.


Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: SDF Dataset Multiline Usage and Other Questions
« Reply #21 on: September 15, 2012, 02:56:04 pm »
OT: taazz, I'm going to open a new topic on your code. My test code is probably to rough for it...

sure the more test cases I get the better the final result will be. Also this is a good opportunity to learn the ins and outs of the SQLDB framework.

Which is the branch that holds the v1.0 release for lazarus and FPC? any one has managed to get a stable behavior from the debugger yet?
Lazarus 1.0
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_0/
is released with FPC 2.6.0
http://svn.freepascal.org/svn/fpc/tags/release_2_6_0/
However, you may want to look into FPC 2.6 fixes (fixes from trunk are regularly backported there) and Lazarus SVN - that seems stable enough and gets a lot of bugfixes.
You can use e.g. fpcup to get that by default.
Otherwise, you could presumably use Lazarus 1.0 fixes http://svn.freepascal.org/svn/lazarus/branches/fixes_1_0/ though I haven't used it.

Thank you, I have in my todo list to set up an svn based environment at some point, Fcup is on my radar as well and I will probably poke you when that time comes but for now I need to find some time to clean up my hard drive, amongst other things.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018