Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search through a grids columns
Message
From
19/11/2003 14:42:45
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00851475
Message ID:
00851595
Views:
8
>How would I go about looking through each column of a grid to find a certain value. What I want to do is to use a loop to go through the columns but I am unsure how to code going from one column to another. Any suggestions?
>
>Thanks in advance
>Kelly

Don't loop through the grid, loop through the grid's source cursor instead.
e.g.
LParameters tuValue
Local lcCursor, ji
lcCursor=thisform.grid.RecordSource && if the cursor name is known, use that instead
Select (lcCursor)
For ji = 1 to FCount()
  If Type(Field(ji))=Type("tuValue") and Eval(Field(ji))=tuValue
    ** you found it
  EndIf
Next
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform