Empty DBF and EOF

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Empty DBF and EOF

Post by Horst »

Hello
I create a DBF and later i have this code

db:gotop()
do while ! db:eof
dbf:fieldget (xy) -> crash

the Prg crashed when the DBF has NO records.
I think, eof shoud be true when the dbf is empty or not ?
For now i fixed it with if db:reccount > 0

Horst
User avatar
Chris
Posts: 4981
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Empty DBF and EOF

Post by Chris »

Hi Horst,

This should work fine, I also just created a small test and I do not get the error.
CAn you please send a small compilable sample showing this problem?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Empty DBF and EOF

Post by Horst »

Hi Chris

I was checking now the dbf. In VO, the dbcreate made dbf files i coud not open with dbAdmin. Size 611 calculated 610. Append on this files was allways no problem , thats why i did not care.
I moved my app in february to x# and it looks like this was a old tempfile created with CAVO.
So i hope this problem is solved in x#

Thanks Horst
Attachments
Bin.zip
(1.25 KiB) Downloaded 68 times
User avatar
Chris
Posts: 4981
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Empty DBF and EOF

Post by Chris »

Hi Horst,

I am sorry, I did not understand what you mean, can you please explain a bit more?
Do you mean there is still a problem, or is it fixed now? If you still get a problem, can you tell me exactly what I need to do, in order to reproduce it?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Empty DBF and EOF

Post by Horst »

Hi Chris

I think , there is no problem in x#. Think x# creates the better files :-)
Because i dont see strange empty dbf files like VO created it. The dbf file in the zip was created by VO.
I will observe it.

Thanks Horst
User avatar
Chris
Posts: 4981
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Empty DBF and EOF

Post by Chris »

Hi Horst,

Ah, thanks, OK I understand now! I tried your code also in VO though, and it also creates the file correctly from what I see. Maybe the dbf you posted was not created by VO, but from another tool..
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Empty DBF and EOF

Post by Horst »

Hi Chris

Its from VO. Maybe its a bug in 2.7 . I did not upgrade to 2.8

Horst
User avatar
Chris
Posts: 4981
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Empty DBF and EOF

Post by Chris »

Hi Horst,

Oh you are right! I just tried with VO27 and indeed I get the same problem!
And it is very strange, because I also had not moved my own VO app to 2.8 and had never seen this problem before. Really strange..
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 337
Joined: Tue Oct 13, 2015 3:27 pm

Empty DBF and EOF

Post by Horst »

Hi Chris

I think normaly you will create a file and then you fill it 99.9999%. The append is working normal.

In my case, there is a situation i dont fill the dbf and then later on i try to read. Then booom.

Horst
User avatar
Chris
Posts: 4981
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Empty DBF and EOF

Post by Chris »

Hi Horst,

Ah indeed, after an Append it all works fine in VO 2.7 also.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply