05-01-2008 10:28 AM
05-02-2008 12:39 PM
Hi bbanacki,
The ResultsList (type = Elements) has a Sort() menthod. You have to specify which property "column" to sort by and whether to sort descending (TRUE) or ascending (FALSE). Try this in DIAdem 10.1 or later:
PropName = MyDataFinder.Results.Columns(1).GetPath(MyResults.Elements(1).Type),
MyResults.Sort(PropName,TRUE)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-02-2008 01:55 PM
05-02-2008 04:12 PM
05-05-2008 07:48 AM
05-05-2008 02:00 PM
Hi BBANACKI,
Try this code that loads the starndard TR_* data files that DIAdem installs-- change the FALSE to TRUE to see the load order invert:
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Set MyDataFinder = Navigator.ConnectDataFinder("My DataFinder")
Set AdvancedQuery = Navigator.CreateQuery(eAdvancedQuery)
AdvancedQuery.ReturnType = eSearchFile
Call AdvancedQuery.Conditions.Add(eSearchFile,"FileName","=","TR_*")
Call MyDataFinder.Search(AdvancedQuery)
Set Elements = MyDataFinder.Results
iMax = Elements.Count
IF iMax > 4 THEN iMax = 4
Call DataDelAll
Call Elements.Sort("FileName", FALSE)
FOR i = 1 TO iMax
LastGroup = GroupCount
Call Navigator.LoadData(Elements(i), "Register")
FOR j = LastGroup+1 TO GroupCount
GroupName(j) = GroupName(j) & " - " & Elements(i).Name
NEXT ' j
NEXT ' i
05-05-2008 03:31 PM
05-06-2008 11:32 AM
Hi BBANACKI,
What is the exact name of the property you want to search on, as it appears in the property table below the tree view or search results list in the NAVIGATOR? Is this the Windows file creation date, the "Storage datetime" that is standard for DataPlugins, or is this a custom date/time property you have created?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-13-2008 12:32 PM
Thanks for your help,
I found out the final piece of the puzzle.... My sort function now sorts by file modify date!!!! sweet.
To sort by modify date I needed to use "modifyTime" in my script..
Modify date — Specifies when the data set was last modified in the operating system.
| Script name | modifyTime |
| Data type | DataTypeDate |
| DataFinder | Search possible |