Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2003-09

Array of const TVarRec issues?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Johnson

I am trying to get TDataSet.SetFields working, so I tried to implemented Assign and AssignValue and just have SetFields call it to do the dirty work instead of doing the same thing. It apears to work for Integers, however any sort of String causes segfault's. Doing a writeln I get the value, but calling AsString it crashes, and moreover an additional check of if (Self is TField) fails. yet when I pass an integer value to the same field, goes through the same routine, and AsInteger and it works fine. Very confusing.

There also seems to be issues with passing an array of const unless it is const value, since I never had issues like this in the past, I pulled out old code I wrote awhile back that worked in 1.0.6 and 1.0.7 that did similar things with tvarrec and co. the old compiled binaries work, but it often causes compiler panics etc on the array of const, and when it does compile after tweaking I get the same issues with using strings and I guess general corruption.

I am wondering if TVarRec and Const has gotten buggy(er) in the last release(1.0.10)? and if so how can I fix/workaround this?

Andrew

Reply by email

Peter Vreman
to Andrew Johnson
Show quoted text 19 lines
I am trying to get TDataSet.SetFields working, so I tried to implemented Assign and AssignValue and just have SetFields call it to do the dirty work instead of doing the same thing. It apears to work for Integers, however any sort of String causes segfault's. Doing a writeln I get the value, but calling AsString it crashes, and moreover an additional check of if (Self is TField) fails. yet when I pass an integer value to the same field, goes through the same routine, and AsInteger and it works fine. Very confusing. There also seems to be issues with passing an array of const unless it is const value, since I never had issues like this in the past, I pulled out old code I wrote awhile back that worked in 1.0.6 and 1.0.7 that did similar things with tvarrec and co. the old compiled binaries work, but it often causes compiler panics etc on the array of const, and when it does compile after tweaking I get the same issues with using strings and I guess general corruption. I am wondering if TVarRec and Const has gotten buggy(er) in the last release(1.0.10)? and if so how can I fix/workaround this?

Without a test it is impossible to check it.

Peter

Reply by email