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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output to screen with LIST

Status
Not open for further replies.

FoxProGirl

IS-IT--Management
Feb 25, 2002
2
0
0
US
When displaying records to screen with the LIST command, the parsing/spaces between fields are too long even though the field itself may be only 10 characters. Is there a way to display the results and shorten the spaces between the fields so that they fit onto one line???
Any help is greatly appreciated.
 
Foxprogirl,

Is there a way to display the results and shorten the spaces between the fields so that they fit onto one line???

No. It is for that reason that most of us have abandoned LIST long ago.

You can add OFF to the command to prevent the display of record numbers, which will shorten the display very slightly. Or you can send the output to a text file (using SET ALTERNATE), then go into a text editor and delete the surplus spaces, but it is a hassle to do so.

I find it easier to create a quick report to display the data in a table.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I really like Mike's solution.

Here's another possibility.


CLEAR
SELECT mydata
SCAN
jnTmpLineNo = 0
FOR jnTmpLineNo = 1 TO 5 STEP 1 && 5 - or whatever
* convert the different data types to "character"
? DTOC(dmyDate)+SPACE(1)+SUBSTR(myMemo,1,25);
+SPACE(1)+ALLTRIM(myCharData)
SKIP
ENDFOR
WAIT [Press The Any Key]
ENDSCAN


HTH - Wayne

 
foxprogirl,

i definitely agree with sir mike's solution. but for some reason you still want to use the good ol' LIST command, it is best to redirect your output to text file and not on the VFP screen.

Code:
USE MyTable
LIST OFF TO FILE c:\MyFile
MODIFY FILE c:\MyFile

or you could use the SET ALTERNATE command as what sir mike has suggested.

hope this helps. peace! [peace]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
-Gen. Joseph Stilwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top