X-Sharp / XSharpPublic

Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
Apache License 2.0
113 stars 38 forks source link

The Use command triggers an error when the path to the dbf file contains spaces. #1468

Closed vfp9 closed 5 months ago

vfp9 commented 5 months ago

Describe the bug An error is triggered when using the Use command to open a dbf with a path that has spaces in it. bug The Chinese description in the picture, translated into English should be: Formats in the path are not supported

To Reproduce Please try:

Use [E:\my test\test.dbf]

Desktop (please complete the following information):

Additional context The following commands are valid in VFP:

Use [E:\my test\test.dbf]
RobertvanderHulst commented 5 months ago

The error indicates that the USE command works, however the RDD fails to open the file.

cpyrgas commented 5 months ago

Xinje, please try putting the file in a similar folder in C:, does the error still occur? Also please check its properties, maybe it's blocked by the OS, as if it was downloaded from the web etc? Can you post the file(s) so we can have a look?

vfp9 commented 5 months ago

Attached is the dbf file I used for testing. I simply changed the file name while testing. PY.zip

cpyrgas commented 5 months ago

Thanks, I see the problem, it's because of the use of brackets for the filename, the preprocessor has a problem with it. The USE command gets translated to

DbUseAreaFox( , "[C:\xSharp\Users\Xinje\my test\py.dbf]", , iif(.F. .or. .F., !.F., NIL), .F.,......

and fails of course.

That's a bug, but for now please replace the [....] with "..." and it should work.

cpyrgas commented 5 months ago

Confirmed fixed