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!

setall columns sparse to .F. 1

Status
Not open for further replies.
Apr 12, 2002
31
0
0
US
Hi all,
Instead of doing this:
This.column1.Sparse = .F.
This.column2.Sparse = .F.
This.column3.Sparse = .F.
This.column4.Sparse = .F.
This.column5.Sparse = .F.

Is it possible to set all of these to .F. with either the setall command or a loop? If so, Tips would be appreciated.



John

[pc] Everything I needed to know I learned from Yoda.
 
this.setall('sparse',.f.)

assuming this is a reference to the grid

 
Thanks fluteplr,
I was trying to use the setall with the .column prefix in front of sparse and it wouldn't work for me.

I was also able to figure out how to do this with a loop construct but I like your approach better, it's less code.

WITH This
i = 0
FOR EACH oColumn IN .COLUMNS
i = i + 1
oColumn.Sparse = .F.
ENDFOR
ENDWITH John

[pc] Everything I needed to know I learned from Yoda.
 
Faster too, at least by a couple of milliseconds.

:)

Your technique is great for setting properties to something that might be difference for each column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top