Skip to content

[VFPDBF] VARCHAR fields in DBFVFP RDD do not return fields with trimmed values #1796

@cpyrgas

Description

@cpyrgas

According to the VFP docs (for example http://foxcentral.net/microsoft/WhatsNewInVFP9_Chapter09.htm), when reading a VARCHAR field, the value should be returned trimmed, but currently in X# it is returned with trailing spaces, just like regular Character fields:

FUNCTION Start() AS VOID
	LOCAL cDbf AS STRING
	cDbf := "c:\test\vfpdbf.dbf"
	? DbCreate(cDbf,{{"VARCHAR","V",10,0}},"DBFVFP")
	? DbUseArea(TRUE,"DBFVFP", cDbf)
	FieldPut(1,"Abc")
	LOCAL cVarChar AS STRING
	cVarChar := FieldGet(1)
	? cVarChar, cVarChar:Length // 10 characters, should be 3

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions