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

field size in DISPLAY/LIST

Status
Not open for further replies.

ajpa

Programmer
Jan 31, 2002
52
GB
When I try to use LIST or DISPLAY either on the screen or on the printer, FoxPro allocates far too much space for the fields so that you can't get more than a couple of fields on one line. You can get round it by turning all the fields into strings and then concatanating them, but there must be a simpler way by ticking an option box somewhere. And what would be nice would be to have the fields line up neatly in columns without having to make the system font monospaced.
 
See these threads for previous discussions:
thread184-1355
thread184-63975
thread184-8471

Rick
 
Rick,

Thanks for this. It's not quite what I want though: my fault for not being clear. I'm trying to display the *contents* of the table rather than the structure. For example SURNAME has only 37 characters, but the next field, INITIALS, say, starts about three quarters of the way across the screen. Even the record number (if I don't include OFF) starts about a quarter of the way across. FoxPro 2 didn't do this. When you separated fields in the DISPLAY command with commas, they followed one another on the printout quite compactly (provided you hadn't made stupidly long headings)

Tony
 
HI you have the following options to display the numeric fields follow a particular character way of displaying.
PICT "999999999" or TRANSORM(myNumber,"99999999") format
or ALLT(STR(myNumber)). These things will reduce the field width to an acceptable width of your choice. The problem with numeric fields is that VFP has to assume that somewhere in your records which could follow the initial record, a figure which takes the maximum possible width and so VFP allocates the maximum possible width by default.
Hope this information helps you :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Ramani,

Thanks for this suggestion. I can't quite see how to incorporate the PICT statement into the DISPLAY command, since the complier reckons that PICT isn't allowed in the command line. (I've only been trying it with character fields since the problem there is just as acute.)

Tony
 
Try using a:
_SCREEN.FontName = "TimesNewRoman"
_SCREEN.FontSize = 8

You are pretty much stuck with the default VFP format unless you do some other things like:

LIST OFF ALLTRIM(SURNAME) + ", " + INITIAL + " " + FIRST

Dave S.
 
Dave,

I was afraid "you're stuck with ...." might turn out to be the answer!

I like the _SCREEN.FontName line of attack. I think I'll write a programme that accepts the field list as parameters, sets the screen font to a monospaced font,scans the table to find maximum field lengths, and then builds a line from each record that will fit my screen and printer.

Thanks for pointing me in the right direction.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top