INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

VFP ?|?? Issue on Windows 10

VFP ?|?? Issue on Windows 10

(OP)
Hi Everyone,

I switched over to a 64bit Windows 10 Pro machine about a month ago and have been running various VFP apps without any issues. However, today I encountered a problem running an app which extracts data into a space delimited file. The space delimited file now had 2 spaces in between data columns when previously there was only 1 space. I can replicate the problem in the command window:

? "12345", ltrim(str(678.90,12,2)) returns 12345 678.90 (2 spaces between the 5 and 6)
should return 12345 678.90 (1 spaces between the 5 and 6)

? "12345"+" "+ltrim(str(678.90,12,2)) returns 12345 678.90 (1 spaces between the 5 and 6)

So, the problem has something to do with the comma separator. SET SPACE ON is set. This should only cause the comma separator to add a single space. I'm wondering if there is some default VFP setting that I'm forgetting to adjust or some other simple adjustment. Has anyone else encountered this issue or does anyone have a suggestion? Also, fwiw, I'm running VFP 9.0 SP2.

Thanks in advance,

Jeff

RE: VFP ?|?? Issue on Windows 10

I don't think there's ever been a promise about how the ? command interprets the , separator. I certainly wouldn't rely on it. If you want to control the format of output, use the COPY TO command.

Tamar

RE: VFP ?|?? Issue on Windows 10

(OP)
Under the VFP documentation, it states:
SET SPACE ON | OFF

Parameters
ON
(Default)
Inserts a space between fields and expressions.

OFF
Removes all spaces between fields or expressions and runs them together.

"a space" means 1 space to me. Anyway, problem solved!! After comparing all settings listed through the debugger, I got to thinking that maybe the debugger dump was not complete. So, I went hunting for more settings. When I looked at Tools/Options/IDE Type:Desktop Font, I saw that my old Win7 PC was set to courier,10,N,1. My new Win10 PC was set to arial,10,N,1. I changed the setting on the new PC and the problem went away... comma separators are now generating only 1 space. I then changed my Win7 settings to Arial and the issue occurred there. So, this is a VFP issue and not a Windows issue.

RE: VFP ?|?? Issue on Windows 10

So it wasn't a case of VFP inserting an extra space. VFP was behaving correctly - as per the spec for SET SPACE. But you were interpreting the single space as two spaces because of the proportional font.

That explains why I couldn't reproduce the problem. When I tested your code, I first set the font to Courier New, precisely because I wanted to be sure of the number of spaces that I could see.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close