Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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 from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Setting text file parameters with Visual Fox Pro 5.0/Windows 7.0

njsandor (TechnicalUser) (OP)
13 May 13 11:32
I just transferred my VFP program to Windows 7.0 and it is running fine. I suspect this question involves the operating system rather than VFP. When I create text files for transmission, it creates text file with Notepad. The default margins and font size are different on the new operating system. As this file is used as a template for transmission, I want to know: how do I confirm if notepad is indeed being used, how do I adjust default margins and font size in this program?
MikeLewis (Programmer)
13 May 13 11:40
What do you mean "it creates a textfile with Notepad"?

It is your program which creating the file. Where does Notepad come into the picture?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

OlafDoschke (Programmer)
13 May 13 11:49
Notepad is displaying text files with one font configured in notepad, the file is a pure text file anyway, it has no font or other formatting info in it.

Bye, Olaf.
jrbbldr (Programmer)
13 May 13 12:03
it creates text file with Notepad

Perhaps this is where the confusion comes from.

NO the file is not Created with Notepad.
It is created with your FP/VFP application and it is a 'generic' text file written to your previous specifications.

Within Windows there is a File Association which 'tells' Windows what application to use when opening files that have a specific file Extension (example: .TXT)

Your current OS has Notepad associated with TXT files so that is what opens when you double click on the file. BUT that does not mean that the file was Created with Notepad.

File associations are changed at the OS level.

Good Luck,
JRB-Bldr


danfreeman (Programmer)
13 May 13 12:14
Text files have NO formatting at all: no fonts, no margins, etc.

Decisions about display are made by the software doing the display.

You asked: how do I confirm if notepad is indeed being used

You could look up the default handler for TXT files in the system registry.

You asked: how do I adjust default margins and font size in this program?

I haven't looked in quite a while. It's only in relative recently versions of Windows that Notepad would even remember previously used settings, which tells me there's probably a registry key. You could try asking around on some Windows forums.

BUT YOU SHOULDN'T DO IT. The whole point of TXT files is they carry no formatting at all and let anyone display the contents in any way they see fit. If you want to control formatting for display, TXT is the last choice I'd take. I'd use PDF instead.
njsandor (TechnicalUser) (OP)
14 May 13 12:49
Thanks for the information. How do I alter VFP text file parameters for font size and margin?
Earl
MikeLewis (Programmer)
14 May 13 12:59
Have you read any of the above posts? VFP does not have "text file parameters". In fact, the term "text file parameters" doesn't really mean anything.

It might help if you can tell us what you are trying to achieve. What the end product is. I'm sure there is a simple solution to your problem, and we'd be glad to help you find it, but so far it's been very difficult to understand what you are asking.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

njsandor (TechnicalUser) (OP)
14 May 13 14:32
I apologize for my ignorance. Let's see if I can be more clear. I was using VFP 5.0 on an older Windows OS. I created text files to transmit to a third party. I just transferred my VFP program to Windows 7.0 and the data on the text file is not fitting onto the text file. The font is bigger and the lines on right margin are being lopped off, making file unusable as information is incomplete. The text file setup was used as a template by the third party and is now unrecognizable to them. No changes were made to VFP program, only transferring to new OS.
I hope this helps and I greatly appreciate your input.
Thanks
Earl
MikeLewis (Programmer)
14 May 13 14:36
OK, Earl, we might be getting somewhere. You say you created the text files. It would be really helpful if you could tell us exactly how you created them. I assume you did it in your program (is that correct)? If so, how exactly did you do it?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

njsandor (TechnicalUser) (OP)
14 May 13 14:49
My VFP database has an option to create files. This file is based on selecting span of dates, with data in that timespan included in file. I don't know if this file selection is within the VFP program, however, that is how I engage it.
Earl
MikeLewis (Programmer)
14 May 13 15:03
Did you write the program yourself? If so, can you show us the code that creates the text files?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

jrbbldr (Programmer)
14 May 13 15:17
My VFP database has an option to create files.

As Mike has alluded to above, your VFP Database does not have that Option.

Perhaps your Application has an Option like that.

And, if so, who created the Application?
Do you have the source code that you can share with us?

Finally when you say: The font is bigger and the lines on right margin are being lopped off

As has been mentioned multiple times, FONTs are NOT Written as part of the Text File.

You most likely have Fonts being used as a Default in the application (Notepad, Word, etc.) that Views the Text File when you open it - but they are not themselves part of the file data.

And, have you opened the file into something like Notepad, ensured that Word Wrap (Top Menu - Format - Word Wrap) is Not Checked and then used the Right Arrow to move your cursor to the FAR RIGHT of any specific line to ensure that it is actually being 'lopped off' instead of merely being visibly off-screen to the right?

Good Luck,
JRB-Bldr
mgagnon (Programmer)
14 May 13 15:51
""""" it has no font or other formatting info in it.

Silly me....I always used the Font option in notepad pad to change the font and font size. I wish you guys would have told me this years ago. (format->font)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483: How to get the best response from the forum first.
ReFox XI (www.mcrgsoftware.com)

jrbbldr (Programmer)
14 May 13 16:22
I always used the Font option in notepad pad to change the font and font size

Yes, within NOTEPAD, you can Display the Text data using the application's Format/Font configuration, but the Text File contents/data does not itself contain this info.

So how a Text file might appear in Notepad, might very well be different than how it might appear in Word, Notepad++, or some other text file editor - depending on how that specific application is configured.

Now that does not apply to other document types such as DOC files where the formatting is included within the file.

njsandor - Good Luck,
JRB-Bldr



OlafDoschke (Programmer)
15 May 13 2:36
Even after your detailed explanation the nature of txt files is every single byte in it is the text, there is no formatting, no font, no margin encoded in the file.

Therefore what you see in notepad only depends on notepad configuration. Dan guessed this configuration is stored in some registry key. That might be the case. All I can say is, if you go into the format->font option of notepad and choose another font, that will be used for display. And not only for that file. The file isn't altered at all, it's merely a display configuration of notepad and has nothing to do with the file itself or its generation.

So, if you can go back to an older system, just look what is configured for the display font there, and set your notepad the same way.
Maybe you need to choose any monospaced font, like Courier instead of the Win7 default of Lucida Console. I think in XP this was Courier New.

As you talk of margins: In the notepad window you will have no margin, unless your application writes out spaces, and then surely a monospaced font would help, but even in a normal proportional font the same number of spaces at the left side cause the same margin width throughout all lines. Notepad doesn't display any margin area at all, if there is no margin added by empty lines and spaces, the only margin options you have in notepad are about printing with margins, and you also set that up. Those settings are not preserved per file, they apply to any file you open in notepad, also generated by other applications.

Bye, Olaf.
OlafDoschke (Programmer)
15 May 13 2:51
>every single byte in it is the text

There is one exception, notepad accepts and writes a few bytes as so called BOM (byte order mark), which denote, which type of codepage the text is encoded in, ANSI, UTF-8 or UNICODE, which not only have differing byte orders but each char can have varying byte length.

That has nothing to do with font or fontsize, or margins. If that would be wrong you would see some or all characters as garbled unreadable wrong characters, but that's not what you describe at all.

Typically there is no BOM at all and ten notepad assumes the default ANSI text, one byte is one letter thn, encoded in the Windows System ANSI codepage, which depends on your locale version of windows, eg it's US or Western European, which don't differ much. You can also set this with the font dialog, you can set the "script", which then might make the codepage include the greek alphabet, for example. Again this would only influence the display of some characters, not their size or the text margin.

Bye, Olaf.
danfreeman (Programmer)
16 May 13 14:07

Quote:

As you talk of margins: In the notepad window you will have no margin, unless your application writes out spaces

Not quite. In Notepad (in the U.S.), the default setup is for a letter sized page (8.5" x 11") with 1" margins at top, bottom, left and right. The default font setting is (IIRC) fixed-spacing at 10 c.p.i. You can adjust any/all of this, and as mentioned previously you can turn off word wrap which effectively kills the margins until printing. (Notepad is a singularly odd beastie when it comes to text editors.)

But in any case, as you say elsewhere, the point is that these settings ARE NOT part of the text file. They are Notepad settings.
OlafDoschke (Programmer)
17 May 13 1:37
dan,

that print margin already shows in the notepad window in the US version? Not only when printing?

Bye, Olaf.
MikeLewis (Programmer)
17 May 13 4:11
Is there such a thing as a US version of Notepad? Surely, Notepad is part of Windows. As such it will have the same language as Windows itself, but the software is the same for everyone and there are no locale settings that are relevant. In any case, what we are talking about here is the default paper size, which is surely a user setting?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

njsandor (TechnicalUser) (OP)
17 May 13 12:16
Could the problem be with the report I am generating, which is then displayed in Notepad/ If so, how do I change settings for report?
Thanks
Earl
jrbbldr (Programmer)
17 May 13 13:07
which is then displayed in Notepad

Have you tried the suggestions above to see if the problems you are 'seeing' are merely about how Notepad is Displaying the text file?

Have you tried opening the Text file into some other application to see what it looks like?
Maybe try some Hex Editor? (I use 010 Editor http://www.sweetscape.com/010editor/)

how do I change settings for report

Many of us have already told you that there are NO 'Settings' in a Text File - just Text.

I guess we are not clear about - How do you know that something is making file unusable as information is incomplete ?

Have you investigated the process that is Receiving the file and attempting to Process it?
That is where you can find out the Specifics of what is not working (if anything).

Good Luck,
JRB-Bldr



MikeLewis (Programmer)
18 May 13 4:26

Quote:

Could the problem be with the report I am generating, which is then displayed in Notepad

This is the first time you've mentioned a report.

A report is never displayed in Notepad. In VFP terms, a report is displayed within the app, either on the screen (in a preview window) or printed to paper. If you really have a VFP-style report, and given that you want to change the margins and font size, then the report is definitely the place to do it.

To achieve that, you need to open the report in the report designer, make the necessary changes, and save the report. Do you know how to do that? We can give you step-by-step instructions, but first let's establish that you really do have a report. If you're seeing the text in Notepad, then it is not a report, and the above is irrelevant.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

danfreeman (Programmer)
18 May 13 11:31

Quote:

that print margin already shows in the notepad window in the US version? Not only when printing?

The print margin never displays. But it can affect line length until you've turned off wordwrap.
danfreeman (Programmer)
18 May 13 11:38

Quote (njsandor)

Could the problem be with the report I am generating, which is then displayed in Notepad/ If so, how do I change settings for report?

YOU ARE NOT LISTENING. sadeyes

There is no formatting in a text file.

Now you're calling it a report. The word "report" has EXTREMELY specific meaning internally inside FoxPro and may or may not result in a text file.

If you were inaccurate in calling the file a text file, it would help explain why you feel there is formatting inside the file. There might be! But it wouldn't be a text file and everyone trying to help you with a text file is wasting their time.

If it IS a text file, please understand that it DOES NOT contain any formatting.

Now, is this really a "report" in the FoxPro sense or is it something your application calls a report that doesn't actually use a FoxPro report form?
OlafDoschke (Programmer)
18 May 13 12:35
Dan,

1. Thanks for pointing out the effect of margin settings to the text line length. I didn't know that feature of notepad.

2. "Now, is this really a "report" in the FoxPro sense or is it something your application calls a report that doesn't actually use a FoxPro report form?"
This is a very good question, i doubt though, that njsandor/Earl can tell that, even if he'd like to help us help him.

Earl, you could please clarify, what your application does, when you start a report:

Does it give a preview window and then when you press a print button creates a text file instead of printing it to a printer?
Does it create a text and opens it up in notepad? (that would be unusual, but possible)
Does it create a text file you open via Windows Explorer and view in notepad?

I can only repeat in all three cases, there is no formatting in text files, so notepad shows a text as is, unless either ine wrapping is turned on, or as I also learned just now from dan, margins affect the line length shown in the notepad window. All these effects are from notepad, and the only way to change it, and to change it permanently, is using the notepad menu items for font and print layout. Neither foxpro nor your application.

If you have a preview situation looking differently to the final text file you view in notepad, that's normal, because VFP reports show a print preview, which includes margins a printer would leave blank, while a notepad window does not show margins and shows the pure text portion, unless you print to a printer.

If you talk of files you view by clicking on them and even don't know the file extension is txt or something else, most probably your windows setting is at the default hiding the extensions like .txt from you, only showing an icon of the file type. Maybe you also have a wrong file extension mapping to notepad. Windows does that to protect users from changing the file extension, rendering a file useless, unless you know what you're doing, but in my opinion that's causing more trouble than it helps users. You can change folder display options to show file extensions and then can tell us, if it's really txt files.

Bye, Olaf.
njsandor (TechnicalUser) (OP)
19 May 13 13:53
Dear All,

Thank you for all your feedback. I'm Earl's wife, the programmer who wrote this application. Let me put this into database programming terms. Keep in mind that I haven't programmed in Foxpro for a while so any help you can provide is most appreciated. The office is running Professional VFP 5.0. It was running on a Dell system using Windows 98. We have moved the system to a new Dell running Windows 7.0. We're still running the program under the old system (Windows 98) until the report we're creating is correctly formatted in Windows 7.0.

In the VFP program I'm creating a report using the following code: Report Form "C:\VFP\Eyeteam\webhic.frx" NOCONSOLE TO FILE "C:\VFP\Eyeteam\fwebmd.txt" ASCII

I search for the report and open it and see that the font size under Windows 98 for this report is courier new regular 10. When I run the same program on Windows 7.0 the font size for this report is Lucida Console regular 10. Data from one of the lines in the report is being truncated under Windows 7.0.

So, I modified Foxpro in Windows 7.0 to run under compatibility mode 640 x 480 screen resolution. (I'm not an expert on compatibility mode but it looked like something good to try) I ran the program and opened the report, checked the font size and it says it's in courier new regular 10 (like the Windows 98 report). However, information is still being truncated in the report (using the Report Form code I listed above).

We transmit this report to a third party who mapped it years ago to allow them to apply each "field" of information on the report to the correct field in their data file.

I'm not sure why the report in Windows 7.0, running under compatibility mode 640 x 480 screen resolution is still truncating data since when I look at it it says the font size is courier new regular 10 (same as it is under Windows 98).

I'm trying to avoid going back into the Report Designer in VFP and reformatting this line and then asking our third party to remap the report. There is much data on the line being truncated. It's one big field that I've written data into.

I pulled out the VFP Developer's Manual and was going to look at the REPORT FORM command to see if there's some attribute I can use to prevent my data from being truncated under the new system.

Suggestions?

Melody

OlafDoschke (Programmer)
20 May 13 2:42
Thanks Melody,

from what you say:

1. There is no font info embedded in fwebmd.txt (as we said many times)
2. All you need to change once and for all time is the font and margin settings of notepad to the same settings of the win98 PC.

Please, this is what several of us already said many times.

Simply change the notepad settings.

Bye, Olaf.
jrbbldr (Programmer)
20 May 13 9:42
Simply change the notepad settings.

I would still like to understand SPECIFICALLY WHAT is not working and SPECIFICALLY WHY (as I asked above).

It will be fine to change Notepad so that the Text file displays differently and maybe as expected, but as we have said MANY times, that will NOT Change the Text File contents.

So if it is indeed the Text file contents that are not working in some recipient application, then has the detailed investigation been done is WHAT IS NOT WORKING in that Application?

Good Luck,
JRB-Bldr






danfreeman (Programmer)
20 May 13 12:55

Quote (njsandor)

In the VFP program I'm creating a report using the following code: Report Form "C:\VFP\Eyeteam\webhic.frx" NOCONSOLE TO FILE "C:\VFP\Eyeteam\fwebmd.txt" ASCII

Cool. We know what we're dealing with: a pure text file with no formatting in it whatsoever.

Quote (njsandor)

I search for the report and open it and see that the font size under Windows 98 for this report is courier new regular 10. When I run the same program on Windows 7.0 the font size for this report is Lucida Console regular 10. Data from one of the lines in the report is being truncated under Windows 7.0.

See above.

As Olaf says, what you're seeing is the default font for Notepad in Windows 7.0. Display actually has nothing to do with content. Change the font once and Notepad will remember it. (Until someone else changes it again, which is a good reason to IGNORE FORMATTING when you're dealing with text files.)



MikeLewis (Programmer)
20 May 13 13:17
Melody,

In an idle moment this morning, I thought I'd reproduce your problem. I created a report, and output it to an ASCII file, just as you did. I opened the file in Notepad, with the default font of Courier New. I then switched to Lucida Console. Several lines were truncated, just as you said.

So, the solution is clear: Within Notepad, switch the font back to Courier New, and everything will be fine. (Alternatively, increase the size of the Notepad window, if that's possible).

As everyone else has said, this is not a FoxPro problem, nor a reporting problem. It's not even a Windows 98 vs. Windows 7 problem. It's simply a question of which font you have chosen in Notepad. If you don't want the lines to be truncated, switch back to Courier New. You only have to do that once; Notepad will remember your setting.

Can you at least try that, and let us know if it solves the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

jrbbldr (Programmer)
20 May 13 13:29
Unless the application which receives the text file and which is NOT WORKING with your output files is NOTEPAD itself (Highly Un-likely), how it is Displayed there is of No Consequence.

It is only a visual representation of your file and another Text editor might display the same Text file differently depending on its own default settings.

It seems as though there has been too much emphasis on how the Text file visually appears in Notepad and not on the actual Real Problem - What is FAILING/NOT WORKING?

Good Luck,
JRB-Bldr



OlafDoschke (Programmer)
21 May 13 11:46
Mike, as you checked, does an embedded Printer info influence the generated ASCII text file?

Eg if you define borders there, does that influence the line breaks? What if you use a report in Win98, which has a printer info embedded and then do REPORT FORM ... To FILE ... ASCII on another computer, not having that printer driver?

That's the only thing, which could have an influence on the result.

Let's inverse the question: As you stated earlier "As this file is used as a template for transmission", it seems you want to have control about the file layout. To do so, use a graphical report and don't print to ASCII file, print to PDF, for example, via a PDF printer driver like Bullzip PDF. Then you get a PDF file, that will look as it looks on any PC.

Also it's unclear what you mean by template. Is this is form to fill in something, when it's printed, later?

So far you have lived with a text file with no formatting and you only have a problem with the display in notepad, which has no influence whatsoever on the file, even if you change your notepad settings. So people receiving these files, which had no problem so far, will continue to have no problem.

You already had this problem in Win98, only YOU saw the file correctly under YOUR notepad Win98 settings, anyone you sent the text file to, has seen it with HIS notepad settings, there is nothing embedded in an ASCII text file.

If you want something over which you have control, switch to PDF now, for example. It depends on how end users should be able to read/write the file. PDFs are merely readonly documents, but they are in the page design you decided, with the fonts you configured in the foxpro FRX report, etc.

Bye, Olaf.
TamarGranor (Programmer)
21 May 13 15:40
My impression is that the file here is being used as input to some kind of processing and thus needs to be text. But maybe that's my mental filters assuming this is about EDI.

Tamar
OlafDoschke (Programmer)
21 May 13 15:51
If it's about EDI, I wonder why going through an FRX at all, you surely had STRTOFILE() back in VFP5, too. Also TEXT..ENDTEXT in conjunction with TEXTMERGE settings. Nothing is easier to use to write out text to a file.

Bye, Olaf.
danfreeman (Programmer)
21 May 13 16:14
No, Strtofile() is more recent than VFP5. But yes, TEXT/ENDTEXZT would have existed.

The thing is, we've all been lead down a rabbit hole with "it doesn't work", but the only definition of "it doesn't work" is "fonts in a text file" which we all know cannot be the issue.

We really need a better explanation of what isn't working.
jrbbldr (Programmer)
21 May 13 16:24
Tamar - My impression is that the file here is being used as input to some kind of processing and thus needs to be text

From what was indicated at the beginning of this LONG thread, that is what I too believed (and I still believe since we have not had original poster response clarifying it).

That is why I mention that we should now quit focusing on how the file appears in Notepad (since that, by itself, quite likely has absolutely nothing to do with what is actually failing) and focus on getting specific details on what within the Recipient Processing Application is failing and why.

We now need Melody to come back with the details of the Actual Problem, not how the text file might appear.

Melody/Earl - Good Luck,
JRB-Bldr

danfreeman (Programmer)
21 May 13 16:30
JRB-Bldr, you and I are on a similar page. The problem is that the OP never said "the other application isn't working". Just that the formatting in the text file was wrong. (And, of course, we know that's bogus.)

Reread the original post. It does not say that anything is broken except for formatting.

So, yes, we need to know what isn't working.
jrbbldr (Programmer)
21 May 13 18:49
Dan

In Earl's (njsandor's) 3rd post on 5/14/13 he says:
The font is bigger and the lines on right margin are being lopped off, making file unusable as information is incomplete. The text file setup was used as a template by the third party and is now unrecognizable to them.

And then in Melody's posting she says:
We transmit this report to a third party who mapped it years ago to allow them to apply each "field" of information on the report to the correct field in their data file.

So it might seem as though the Recipient's Field Mapping is no longer working - however that is accomplished.

Dan - you and I and the other gurus here already know this but Field Mapping HAS NOTHING TO DO WITH NOTEPAD OR FONT SIZE. - unless, and it would be very unlikely, that the Recipients were using Image Processing and/or Optical Character Recognition (OCR) - especially unlikely on something as simple as a Text file.

So, once again, we need Melody to come back with her better understanding of the issues and provide us with the details of the Actual Problem as determined at the Recipient's end - not just the vague: "it no longer works".

Melody/Earl - Good Luck,
JRB-Bldr
mm0000 (IS/IT--Management)
21 May 13 20:43


To change the default Notepad display font and size, modify the Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Notepad\DefaultFonts. Change the lfFacename keyword value to 'Courier New'. If you want to change the font size change the iPointsize keyword value.

Bye,

MM

OlafDoschke (Programmer)
22 May 13 7:07
Either Earl and Melody already found a solution, or the problem turned out to be just visually looking as if.

The font is bigger and the lines on right margin are being lopped off
That could simply mean the notepad window isn't wide enough, not text really being lopped off.
The text file setup was used as a template by the third party and is now unrecognizable to them.
If their judgement about the file being unrecognizable, too just was made by visual inspection, then perhaps there never was a real problem.

If data needed to be at certain line/col positions and that changed, then really the content of the output text file changed somehow. So my question about the influence of embedded printer info in an FRX towards ASCII output would be the only thing that matter.

Now I simply glimpsed into the help file on REPORT FORM. the "TO Outputdestination" is explainied in detail in the last third of the help topic. [FILE] FileName2 [[ADDITIVE] ASCII] is one possible Outputdestination, and the ASCII clause is described as:

Quote (VFP help topic REPORT FORM)

An ASCII file contains only text. If the report is a character-based layout definition created in FoxPro for MS-DOS, dashes, and plus signs may be included to represent lines and shapes. Otherwise, any font or color settings, graphics, lines, rectangles, or rounded rectangles in the report definition file do not appear in the ASCII text file. You can specify the number of characters to place on each line and the number of lines to place on each page by using the _ASCIICOLS and _ASCIIROWS system variables.

That still doesn't say if margin settings of printer info influence line width, but you have two system variables _ASCIICOLS and _ASCIIROWS.

The help on _ASCIICOLS says a default for it is 80, the OS does not define it, eg it's a VFP system variable, not a OS environment variable.

So if no printer page setup info embedded in the FRX would influence output to ASCII, there is no OS influence at all and it merely was the visual inspection with notepad, which was not looking the same was as on Win98. You could double check that by moving a new file to the old system and opening it there. Then there was no problem at all.

Bye, Olaf.

njsandor (TechnicalUser) (OP)
2 Jun 13 13:32
Thanks to everyone for their feedback on this problem.

I changed notepad's font size in Windows 7.0 to match what I was using in Windows 98. AND, I decreased the right margin from .75 to .25. My data was still being truncated.

I put the code ? fln1
wait "fln1" timeout 6
in my code to make sure the entire line of code was being captured correctly and everything checked out. It was. Here's the line of code I'm working with:

REPLACE fln1 with ALLTRIM(DTOC(tfld24aa)) + " " + ALLTRIM(DTOC(tfld24ab)) + ;
" " + ALLTRIM(tfld24b) + " " + ALLTRIM(tfld24da) + " " + ;
ALLTRIM(tfld24db) + " " + ALLTRIM(tfld24e) + S24F + S24FF + ;
ALLTRIM(STR(tfld24f,7,2)) + " " + ALLTRIM(SUBSTR(tfld24g,1,1)) + " " + ALLTRIM(SUBSTR(npi,1,10))

The npi number (last field) was being truncated. I did a test and changed the npi ALLTRIM command to read ALLTRIM(SUBSTR(npi,1,9)) {one character shorter)} to see if the npi # would appear when I opened notepad. Success! It appeared. I removed one space between ALLTRIM(tfld24b) AND ALLTRIM(tfld4da) and the npi # in it's entirely appeared in Notepad. I'm going to ask our third party to remap this file since I've modified the data placement in this line.

All the Professional VFP code and data files were simply copied from our Windows 98 computer to our Windows 7.0 computer. No changes were made. For some reason the program under Windows 7.0 can't accommodate the length of that long field(???) I'm not going to spend any more time on it. I've fixed it, it will be remapped and we'll go on.

Thanks again for everyone's input!

Melody
OlafDoschke (Programmer)
2 Jun 13 14:10
Melody,

In regard to your code, hopefully you're conscious about ALLTRIM trimming off spaces, making the whole output variable length and variable positions of data, in contrast of what you want. If you need exact positioning in certain columns, don't use ALLTRIM, then use PADL or PADR to pad to a predefined width. Any of the fields may be something like a counter, having had a recent carry to a +1 longer string, and therefore now shifted. Then it was mere coincidence, this happened in the transition to Win7. And obviously any shift anywhere causes the last field to be shifted.

I believe what you say is what you see, but it's still not a reason of notepad nor windows.
[quote]The npi number (last field) was being truncated. I did a test and changed the npi ALLTRIM command to read ALLTRIM(SUBSTR(npi,1,9)) {one character shorter)} to see if the npi # would appear when I opened notepad.[/code]
If the line is too long just by one char, and some value in some field must have become on char wider, then instead of inspecting notepad, you should inspect your data field via browse and see if the last char of npi came through to the fln1 field. If it's already missing there, you of course can do what you want in notepad, and removing a space and repositioning columns by one char this way helps, but what about enlarging the field fln1 and make it one char larger? Or making it a memo? In a memo fln1 can be as wide as you like, and also notepad has no practial line width limitation.

If the char is NOT missing in fln1, if it's really just missing in notepad, make your font setting one point lower than in win98. Win7 uses new fonts, also Aero windows style means wider borders and so the notepad window is a few pixels narrower in the same screen size. But if it would be that, then there wouldn't have been a binary difference in the file. So most probably it's just all about ALLTRIM() and one field having got one char wider data in it.

Bye, Olaf.



danfreeman (Programmer)
2 Jun 13 14:44
Here we go again. <chuckle>

Melody, I agree with everything Olaf said and I'll add some more that he undoubtedly thought about but got tired before mentioning it. smile

You show a REPLACE command. REPLACE does not create a text file. You do not show how the text file is created. If it's a COPY TO from a memo field, you could have suffered from "lucky data" (as Olaf mentioned) that suddenly got too wide to fit within SET MEMOWIDTH. Alltrim() can be really dicey in composing long strings for precisely this reason. You cannot control the ultimate length of the string.

Again, none of this has anything to do with Notepad or text files. It's data.

I'm afraid you'll be back at this some time soon when another field makes the string wider, and you'll still be chasing ghosts wondering what's wrong with Notepad when it has nothing whatsoever to do with Notepad.
jrbbldr (Programmer)
3 Jun 13 9:39
I've fixed it, it will be remapped and we'll go on.

That's great, but AS WE HAVE SAID OVER AND OVER ABOVE, the problem is not in Notepad nor in Windows.

Instead it is, and has always been, elsewhere and you have been determinedly focusing on the wrong symptom by looking at the issue in Notepad.

Some of us have suggested above that you look at the results, not in Notepad, but in some other text editor tool or in some other manner (such as in VFP Browse) so as to find find the REAL cause of the problem and thereby resolve it in the best and most effective manner.

Good Luck,
JRB-Bldr


jrbbldr (Programmer)
3 Jun 13 10:03
Now that I think about it...

it will be remapped and we'll go on.

If the data can be Re-Mapped successfully, that means that there was Never a problem there at all with the data itself - all of the data is still there.
If so, then the only problem was in how the data was perceived when displayed/viewed in Notepad.

Good Luck,
JRB-Bldr


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!

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