Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP9: Another reason to stay away from Varchar

Status
Not open for further replies.

Olaf Doschke

Programmer
Oct 13, 2004
14,847
DE
Hi all,

execute this:
Code:
CREATE TABLE curDeltest (vText V(30)) 
INSERT INTO curDeltest values(Sys(2015)) 
INSERT INTO curDeltest values("") 
INSERT INTO curDeltest values(Sys(2015)) 
GO TOP
BROWSE NOWAIT

Now choose the second, empty record and press DEL.
Or: Clear all records, then type "Hello" in the first record, press DOWNARROW and DEL alternatingly and you get "ello" and "llo" in the second and third line.

This was reported by Bernhard Sander in the German Foxpro user group and could be verified by others including me.

I still wonder if it is a bug of varchar or the browse window. The impact may be small, but on the other hand I don't see a real benefit of varchars when not using a remote database. DBFs don't get shrinked in size and the only thing a varchar field does is an automatic RTRIM() when accessing the field.

Bye, Olaf.
 
I think this is a huge BUG :) (no metter where)
and must be reported to VFPT.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 

As far as I can see, this only happens in a browse (and perhaps therefore also a grid).

If you do this:

GOTO 2
REPLACE Vtext with ""

there seems to be no problem. (But I haven't done an exhaustive test.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hello Mike,

thanks for sorting that out. Acknowledged: This is browse and grid related.

Bye, Olaf.
 
Would this not be considered an undocumented feature?

Regards,

Rob
 

Rob,

Would this not be considered an undocumented feature?

Well, I can't speak for anyone else, but I'd definitely consider it a bug.

On the other hand, I'm not sure I agree that this is a reason to stay away from Varchars. It's true that they don't have much value in DBFs, as Olaf pointed out. But they make a big difference when working with back-end tables. At the very least, they overcome the biggest obstacle to using remote views.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Rob,

I don't think you meant that sarcastic, do you?

How would anybody benefit of that? It may only be annoying to carry values (except the first character) to other records, but if that feature is wanted, there are certainly better ways than to make use of that bug.

Bye, Olaf.

PS: Bugreporting nowadays is no privilege or secret. If there is a VFP bug, that annoys you, go to and report it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top