Re: [Lazarus] TFMTBCDField problem

2014-11-22 Thread Chris Rempas
i just hope i did it correctly
thanks for all the help :) 

 On Friday, November 21, 2014 11:05 AM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 11/18/2014 06:02 PM, Chris Rempas wrote:
 I guess i was wrong, the best solution is the first one, atr least in my
 tests

 can someone help me put a bug report with the fix?

Just visit bugs.freepascal.org, add an account and fill in the 
bug-report form. Don't forget to send in your patch. You can use 
subversion to create the patch. (On the command-line: svn diff)

Regards,
  Joost.



   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-18 Thread Chris Rempas
I guess i was wrong, the best solution is the first one, atr least in my tests
can someone help me put a bug report with the fix?
Regards
Chris

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-09 Thread Chris Rempas
I am almost convinced that the problem is not what i am seeing...this code works
if VSQLVar^.sqlscale = 0 then  i := AParams[ParNr].AsIntegerelse//i := 
Round(AParams[ParNr].AsCurrency * IntPower10(-VSQLVar^.sqlscale));
  i := Round(BCDToDouble(AParams[ParNr].AsFMTBCD) * 
IntPower10(-VSQLVar^.sqlscale));

the reason i think that this is not a *real* fix, is that the TParam.asCurrency 
returns a Varriant and this raises the error, but TParam.AsFMTBCD returns a 
TFMTBCD Value converted from a variant! This *should* raise the same error, but 
it doesn't
How could i have debug info in FMTBCD unit? i would like to take a look at this 
BCDFactory

PS : I am really trying to fix the problem and not just patch around it, i have 
the highest hope in your understanding and help :)
Regards,Chris


 On Sunday, November 9, 2014 12:08 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 11/09/2014 03:37 AM, Chris Rempas wrote:
 I copied the binaries that were missing in my FPC 2.7.1 from FPC2.6.4
 i run make clean all and make install again and VOILA! i have debug! :)))
 (it seems all the binaries must be in the same directory for some reason)

I don't really understand which binaries you did copy. But I'm glad you 
have the debug-info.

 FILE dsparams.inc, LINE 519
 Function TParam.GetAsCurrency: Currency;
 begin
    If IsNull then
      Result:=0.0
    else
      Result:=FValue;     519
 end;

For 'BCD' fields, the Currency type is used. In your case you have 5 
decimals, so you can not use .AsCurrency...

 when the parser gets the values of the params, this param is BCD and as
 you can see it tries to get it as currency

 In a quick check, methods [AssignToField] [AssignFromField] [GetData]
 [SetData] are not fully ready for every FDataType
 some are missing BCD Fields, some are missing FMTBCD Fields and
 sometimes it gets the same treatment as Currency...

Currency and BCD are the same. So apparently support for FMTBCD fields 
is missing here. As the FMTBCD support is relatively new this could just 
be missing.

 I am guessing at this point that i don't have the latest code

 if i could have a copy of the latest component, i would be able to test
 and maybe help debug with real testing

2.7.1 is the latest version? Yo have to find out where/why the FMTBCD 
param is accesses as AsCurrency (Assign, GetData, SetData?), and fix 
that. Then you can simply recompile fcl-db and see if your program works.

Oh, and if you have fixed the problem, send us a patch. ;)

Joost.



   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-08 Thread Chris Rempas
Hi, it compiled correctly but i still can't get debug infoI tried to be a 
smartass and make clean all with OPT=-gl but of course it failed!the closest i 
got to the error is in ibconnection.pp fileprocedure 
TIBConnection.Execute(cursor: TSQLCursor;atransaction:tSQLtransaction; AParams 
: TParams);var tr : pointer;    out_SQLDA : PXSQLDA;begin  tr := 
aTransaction.Handle;  if Assigned(APArams) and (AParams.count  0) then 
SetParameters(cursor, atransaction, AParams);  with cursor as TIBCursor do  
begin    if FStatementType = stExecProcedure then      out_SQLDA := SQLDA    
else      out_SQLDA := nil;    if isc_dsql_execute2(@Status[0], @tr, 
@Statement, 1, in_SQLDA, out_SQLDA)  0 then      CheckError('Execute', 
Status);  end;end;where i guess one of the pointers fail.My problem is that i 
don't know the exact line of the error, i have a snapshot of my screen but i 
can't send it to the list because of the size limits 

 On Saturday, November 8, 2014 6:28 PM, Chris Rempas cror...@yahoo.com 
wrote:
   

 Hi, it compiled correctly but i still can't get debug infoI tried to be a 
smartass and make clean all with OPT=-gl but of course it failed!the closest i 
got to the error is in ibconnection.pp fileprocedure 
TIBConnection.Execute(cursor: TSQLCursor;atransaction:tSQLtransaction; AParams 
: TParams);var tr : pointer;    out_SQLDA : PXSQLDA;begin  tr := 
aTransaction.Handle;  if Assigned(APArams) and (AParams.count  0) then 
SetParameters(cursor, atransaction, AParams);  with cursor as TIBCursor do  
begin    if FStatementType = stExecProcedure then      out_SQLDA := SQLDA    
else      out_SQLDA := nil;    if isc_dsql_execute2(@Status[0], @tr, 
@Statement, 1, in_SQLDA, out_SQLDA)  0 then      CheckError('Execute', 
Status);  end;end; where i guess one of the pointers fail.My problem is that i 
don't know the exact line of the error, i have a snapshot of my screen but i 
can't send it to the list because of the size limits



 On Friday, November 7, 2014 7:24 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 11/06/2014 09:53 AM, Chris Rempas wrote:
 I just fixed my program so we are back to the original problem

 Invalid variant type cast on ApplyUpdates

 i repeat, i can post the record, but i cannot read or write a record
 that has data on this field to the database

That's really strange. Here it works, and also the testsuite has some 
tests for this.

What you could do is build fcl-db with debug-info. Search for the fcl-db 
sources (packages/fcl-db). Open a command-line (powershell) and make 
fcl-db the current directory. Then do 'make clean all OPT=-gl'. And then 
do 'make install'. Note that it could be that you have to run pwoershell 
as administrator to be able to do a 'make install'.

Now rebuild your application and try again. Now you should be able to 
see where the problem arises, and get some more information using the 
debugger.

Regards,

Joost.





   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-06 Thread Chris Rempas
I just fixed my program so we are back to the original problem
Invalid variant type cast on ApplyUpdates
i repeat, i can post the record, but i cannot read or write a record that has 
data on this field to the database 

 On Wednesday, November 5, 2014 10:30 PM, Chris Rempas cror...@yahoo.com 
wrote:
   

 so where do i send the flowers? :)
and another question...where is the conversation about the string --- 
UTF8Sting convertions?
i had to use UTF8String in a library and is not compiling now because i call 
UTF8Delete and it says that parameter arguments must match exactly 

 On Wednesday, November 5, 2014 4:50 PM, Joost van der Sluis 
jo...@cnoc.nl wrote:
   

 On 11/05/2014 10:39 AM, Chris Rempas wrote:
 You were correct!

 changing to the correct path does not compile again!

 i get just one line with error :
 registerfcl.pas(43,3) Fatal: Can not find unit ServiceManager used by
 RegisterFCL. Check if package FCL is in the dependencies.

You could try to run Free Pascal on the command-line (powershell). Try 
'ppc386 -vut'. Then see which fpc.cfg is being used. Open that file and 
search for lines that start with '-Fu' and see if the path is correct. 
(It should point to c:\pp - if that's where you've installed fpc)

Joost.





--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-05 Thread Chris Rempas
You were correct!
changing to the correct path does not compile again!
i get just one line with error :registerfcl.pas(43,3) Fatal: Can not find unit 
ServiceManager used by RegisterFCL. Check if package FCL is in the dependencies.

Regards,Chris 

 On Monday, November 3, 2014 5:38 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 11/02/2014 08:05 PM, Chris Rempas wrote:
 Latest news!
 I did a full uninstall and install Lazarus again, installed my
 components, compiled my project.
 Then, i changed the FPC folders to 2.7.1 and rebuild Lazarus. worked fine.
 Execute program, crush on reading real values.
 I put NULL in the database, execute program, all ok!

I'm affraid you are still using fpc 2.6.4. With your re-installation of 
Lazarus, you also restored the old fpc-version.

Please make sure that in tools-options also the compiler-path points to 
fpc/ppc386/ppcx64 of version 2.7.1. (ie: c:\pp\..)

Joost.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-05 Thread Chris Rempas
so where do i send the flowers? :)
and another question...where is the conversation about the string --- 
UTF8Sting convertions?
i had to use UTF8String in a library and is not compiling now because i call 
UTF8Delete and it says that parameter arguments must match exactly 

 On Wednesday, November 5, 2014 4:50 PM, Joost van der Sluis 
jo...@cnoc.nl wrote:
   

 On 11/05/2014 10:39 AM, Chris Rempas wrote:
 You were correct!

 changing to the correct path does not compile again!

 i get just one line with error :
 registerfcl.pas(43,3) Fatal: Can not find unit ServiceManager used by
 RegisterFCL. Check if package FCL is in the dependencies.

You could try to run Free Pascal on the command-line (powershell). Try 
'ppc386 -vut'. Then see which fpc.cfg is being used. Open that file and 
search for lines that start with '-Fu' and see if the path is correct. 
(It should point to c:\pp - if that's where you've installed fpc)

Joost.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-11-02 Thread Chris Rempas
Latest news!I did a full uninstall and install Lazarus again, installed my 
components, compiled my project.Then, i changed the FPC folders to 2.7.1 and 
rebuild Lazarus. worked fine.Execute program, crush on reading real values.I 
put NULL in the database, execute program, all ok!
This means the problem is in the conversion (TBCD -- Variant) and not in the 
DB components
ZEOS DB works fine but it uses TFloatFieldI tried to manually use TFloatField 
instead of TFMTBCDField and got error in loading
ZEOS DB is very slow and i cannot use it.
If you can help me figure out how i can trace these conversion calls, maybe i 
can help fixing this
Regards,
Chris 

 On Sunday, November 2, 2014 2:44 AM, Chris Rempas cror...@yahoo.com 
wrote:
   

 Latest news!I did a full uninstall and install Lazarus again, installed my 
components, compiled my project.Then, i changed the FPC folders to 2.7.1 and 
rebuild Lazarus. worked fine.Execute program, crush on reading real values.I 
put NULL in the database, execute program, all ok!
This means the problem is in the conversion (TBCD -- Variant) and not in the 
DB components
ZEOS DB works fine but it uses TFloatFieldI tried to manually use TFloatField 
instead of TFMTBCDField and got error in loading
ZEOS DB is very slow and i cannot use it.
If you can help me figure out how i can trace these conversion calls, maybe i 
can help fixing this
Regards,Chris 

   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-30 Thread Chris Rempas
...as a last resort, i formatted an old disk, installed windows 8.1, installed 
lazarus, downloaded a new snapshot from freepascal site, extracted and followed 
instructions.
I get an error (i think in fpmkunit.pp) when i execute make clean all.i tried 
to execute make install but i get the same error 
Regards,Chris

 On Monday, October 27, 2014 5:01 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 10/27/2014 09:28 AM, Chris Crori wrote:
 Hi Vincent,
      can you help me build lazarus with fpc 2.7.1?  I downloaded fpc
 trunk, changed the file folders, undated the lazarus configuration, but
 I cannot build fpc and lazarus tells me it can’t find fpc.cfg file...
 the file exists!

When you have downloaded fpc 2.7.1, go to the command-line and do 'make 
clean all'. Make sure that the compiler-executable (ppc386.exe and 
fpc.exe) are in your search-path. If you are on Windows this is not 
always the case. (set path=%path%:c:\lazarus\fpc\2.6.4\bin\i386-win32)

Then you have to do a 'make install'. But to do so, you need 
administrator-rights. So make sure that you use the right-mouse button 
when you start your console (cmd or poweshell) and select 'run as 
administrator'.

If you passed this step, you have fpc installed in c:\pp. Adapt the path 
so that it points to this new location for the compiler-binaries. (Nore 
that you still need a reference to the old lazarus-fpc-location, because 
it also contains helper utilities like make.exe)

If you are editing the fpc.cfg file, search for the lines that start 
with -Fu.  Those need changing.

If you want to know where to place your fpc.cfg, use ppc386.exe -vt.

Then adapt the Lazarus configuration, and you should be done.

There are also scripts that do all this for you, btw.

Joost.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-30 Thread Joost van der Sluis

On 10/30/2014 04:45 PM, Chris Rempas wrote:

...as a last resort, i formatted an old disk, installed windows 8.1,
installed lazarus, downloaded a new snapshot from freepascal site,
extracted and followed instructions.

I get an error (i think in fpmkunit.pp) when i execute make clean all.
i tried to execute make install but i get the same error


Can you show us the error?

Regards,

Joost.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-27 Thread Chris Crori
Hi Vincent,

can you help me build lazarus with fpc 2.7.1?  I downloaded fpc trunk, 
changed the file folders, undated the lazarus configuration, but I cannot build 
fpc and lazarus tells me it can’t find fpc.cfg file... the file exists!

I took a look to the changes in variants.pp and I think that all changes 
effect readability, tBCD cannot be converted to variant, so it can’t still be 
passed to SQLdb to execute ApllyUpdates

Regards
Chris


From: Vincent Snijders 
Sent: Monday, October 27, 2014 7:31 AM
To: Lazarus mailing list 
Subject: Re: [Lazarus] TFMTBCDField problem


2014-10-24 13:28 GMT+02:00 Joost van der Sluis jo...@cnoc.nl:


  And I received a warning from Vincent that building the snapshot failed.

  So I know for sure that these snapshots are still being build. Maybe you have 
just bad luck that it is not available today, due to a mistake from me. So 
maybe wait one day, or that someone else can point out where the snapshot (from 
a day earlier) can be found.


That was not from a snapshot installer build, but from a build server which 
just tests compilation. It does make all, does not package and does not upload, 
delete old snapshots etc.


Vincent




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-27 Thread Joost van der Sluis

On 10/27/2014 09:28 AM, Chris Crori wrote:

Hi Vincent,
 can you help me build lazarus with fpc 2.7.1?  I downloaded fpc
trunk, changed the file folders, undated the lazarus configuration, but
I cannot build fpc and lazarus tells me it can’t find fpc.cfg file...
the file exists!


When you have downloaded fpc 2.7.1, go to the command-line and do 'make 
clean all'. Make sure that the compiler-executable (ppc386.exe and 
fpc.exe) are in your search-path. If you are on Windows this is not 
always the case. (set path=%path%:c:\lazarus\fpc\2.6.4\bin\i386-win32)


Then you have to do a 'make install'. But to do so, you need 
administrator-rights. So make sure that you use the right-mouse button 
when you start your console (cmd or poweshell) and select 'run as 
administrator'.


If you passed this step, you have fpc installed in c:\pp. Adapt the path 
so that it points to this new location for the compiler-binaries. (Nore 
that you still need a reference to the old lazarus-fpc-location, because 
it also contains helper utilities like make.exe)


If you are editing the fpc.cfg file, search for the lines that start 
with -Fu.  Those need changing.


If you want to know where to place your fpc.cfg, use ppc386.exe -vt.

Then adapt the Lazarus configuration, and you should be done.

There are also scripts that do all this for you, btw.

Joost.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-26 Thread Vincent Snijders
2014-10-24 13:28 GMT+02:00 Joost van der Sluis jo...@cnoc.nl:


 And I received a warning from Vincent that building the snapshot failed.

 So I know for sure that these snapshots are still being build. Maybe you
 have just bad luck that it is not available today, due to a mistake from
 me. So maybe wait one day, or that someone else can point out where the
 snapshot (from a day earlier) can be found.


That was not from a snapshot installer build, but from a build server which
just tests compilation. It does make all, does not package and does not
upload, delete old snapshots etc.

Vincent
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-24 Thread Chris Rempas
Hi,  I downloaded trunk fpc but i can't get it to work, is there an easy way to 
get fpc 2.7.1 compiled for lazarus?
Thanks
Chris
 

 On Thursday, October 23, 2014 4:03 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 10/23/2014 01:07 AM, Chris Rempas wrote:
 Hi guys!
      I am using SQLdb with Firebird 2. I have a DECIMAL(9,5) field that
 SQLdb makes it TFMTBCDField automatically. Mt problem is that i cannot
 save any value to the database. If i let the field with the NULL value,
 my record is saved fine, if i try to put any value and save the record,
 it fails with Invalid Variant convertion error.
      I Edited the record with an external tool and it loads up fine in
 my grid. In my grid i can change the data and scroll to another records
 (cached data is fine) but if i try to execute ApplyUpdates, i get the
 same error.

      Google could not help and i could not find anything in the
 bugtracker for the last 3 days!

If you are using fpc 2.6.4, could you try 2.7.1? (A development snapshot)?

Joost.



   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-24 Thread Joost van der Sluis

On 10/24/2014 09:22 AM, Chris Rempas wrote:

   I downloaded trunk fpc but i can't get it to work, is there an easy
way to get fpc 2.7.1 compiled for lazarus?


Hmm, it was always available at the snapshot-page 
http://www.hu.freepascal.org/lazarus/ but it's not there.


Maybe that the 2.7.1 snapshot is not build anymore. But coincidentally I 
made a change in fpc 2.7.1 yesterday that broke building fpc on Windows.


And I received a warning from Vincent that building the snapshot failed.

So I know for sure that these snapshots are still being build. Maybe you 
have just bad luck that it is not available today, due to a mistake from 
me. So maybe wait one day, or that someone else can point out where the 
snapshot (from a day earlier) can be found.


Joost.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-24 Thread Chris Rempas
This is killing me! i just want my headache to stop!
Thanks for the responce,I will check for the updates 
Chris

 On Friday, October 24, 2014 2:29 PM, Joost van der Sluis jo...@cnoc.nl 
wrote:
   

 On 10/24/2014 09:22 AM, Chris Rempas wrote:
    I downloaded trunk fpc but i can't get it to work, is there an easy
 way to get fpc 2.7.1 compiled for lazarus?

Hmm, it was always available at the snapshot-page 
http://www.hu.freepascal.org/lazarus/ but it's not there.

Maybe that the 2.7.1 snapshot is not build anymore. But coincidentally I 
made a change in fpc 2.7.1 yesterday that broke building fpc on Windows.

And I received a warning from Vincent that building the snapshot failed.

So I know for sure that these snapshots are still being build. Maybe you 
have just bad luck that it is not available today, due to a mistake from 
me. So maybe wait one day, or that someone else can point out where the 
snapshot (from a day earlier) can be found.

Joost.


   --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFMTBCDField problem

2014-10-23 Thread Joost van der Sluis

On 10/23/2014 01:07 AM, Chris Rempas wrote:

Hi guys!
 I am using SQLdb with Firebird 2. I have a DECIMAL(9,5) field that
SQLdb makes it TFMTBCDField automatically. Mt problem is that i cannot
save any value to the database. If i let the field with the NULL value,
my record is saved fine, if i try to put any value and save the record,
it fails with Invalid Variant convertion error.
 I Edited the record with an external tool and it loads up fine in
my grid. In my grid i can change the data and scroll to another records
(cached data is fine) but if i try to execute ApplyUpdates, i get the
same error.

 Google could not help and i could not find anything in the
bugtracker for the last 3 days!


If you are using fpc 2.6.4, could you try 2.7.1? (A development snapshot)?

Joost.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TFMTBCDField problem

2014-10-22 Thread Chris Rempas
Hi guys!    I am using SQLdb with Firebird 2. I have a DECIMAL(9,5) field that 
SQLdb makes it TFMTBCDField automatically. Mt problem is that i cannot save any 
value to the database. If i let the field with the NULL value, my record is 
saved fine, if i try to put any value and save the record, it fails with 
Invalid Variant convertion error.I Edited the record with an external 
tool and it loads up fine in my grid. In my grid i can change the data and 
scroll to another records (cached data is fine) but if i try to execute 
ApplyUpdates, i get the same error.
    Google could not help and i could not find anything in the bugtracker for 
the last 3 days!

Please help!!!
Regards,
Chris
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus