>>>>>I am looking for a sample like step 1. in the FORM
>>>>>Wizard that shows you how you can select the fields
>>>>>you want. I would like this so my users can pick the
>>>>>fields they want to SORT on. After they pick the fields
>>>>>that want, they click OK and the program will build a INDEX from their choices using a string.
>>>>>example..
>>>>>
>>>>>INDEX ON string TAG yourindx
>>>>>
>>>>>Can you help?
>>>>I was modifying an app which had a combobox whose .RowSourceType property was 8 - structure. It didn't look like page1 of the wizard or anything, it was just a combo, but it did what you want - it gave a list of the fields. However, I promptly got rid of it. In the case of my table, there were several fields which the customer would never use for sorting. I asked the customer what fields would be used for sorting, and created a half-dozen index tags. The RowSourceType for my box is now an array. I have a function which reads TAG(i) into the array, looping from 1 to TAGCOUNT(), and excluding tags I didn't want to use. This approach worked for me because the number of index tags is not so large, so reindexing shouldn't take too long. I suppose that if I had many more fields that could be used for sorting, I could have tried using .RowSourceType = 8 - structure and then used the .RemoveItem method to remove fields (such as logical fields) which would make dumb sort fields.
>Then
>>>I
>>>>could have made index tags for the most commonly used ones and used INDEX ON for less commonly used ones.
>>>
>>>Hi Bret...
>>>I loaded a COMBO BOX with the RowSource as an array, but, at load time, it
>>>can not find the array source. Where do you put your code for the array?
>>>
>>>Rob
>>I made the array a property of the form, then filled the array in the FORM.Init, then did a THISFORM.Combo.Requery. That may not be the best way, but it worked.
>
>I tried that and it did not work.
>I did a:
>a) new property called TESTARRAY
>b) code in INIT EVENT of the FORM
> declare TESTARRAY[3]
> STORE "ONE" TO testarray[1]
> STORE "TWO" TO testarray[2]
> STORE "THREE" TO testarray[3]
>C) THISFORM.combo1.REQUERY
>
>HELP..
If your new property specifically said TESTARRAY(3) or TESTARRAY(3,0), I think you would not need to DECLARE it in the INIT. I'm not sure what went wrong with your code, however, to be more specific, here is my code:
iTgCount = TAGCOUNT()
IF iTgCount > 0
DIMENSION aHoldList (iTgCount)
iFinalSize=GetTags(@aHoldList,iTgCount,THISFORM.cTagExclude)
DIMENSION aHoldList(iFinalSize)
DIMENSION THISFORM.aTagsToUse(iFinalSize)
=ACOPY(aHoldList,THISFORM.aTagsToUse)
ENDIF
THISFORM.ComboSort.Requery
THISFORM.ComboSort.Value = THISFORM.aTagsToUse(2)
GetTags is a UDF which loops through TAG(i) FOR i = 1 TO iTgCount, checks each tag to see if it is in cTagExclude (a string of fieldnames that would make dumb tags) and fills aHoldList with the useful ones. I use it in a few places. The last line picks a default tag.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only