The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 findfiles and sorting array
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 02/27/2004 :  09:07:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Can anyone please confirm that FindFiles will always return the file names in sorted (ascending order)?

Which leads on to the next question ... any thoughts or recommendations re sorting arrays generally - numeric, alphanumeric or text? Do we have to do our own code?

Cheers,

pete

Mike Buess

USA
3037 Posts

Posted - 02/27/2004 :  09:17:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

StringArray is vector<string> so vectorbase::Sort should work.

Mike Buess
Origin WebRing Member
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/27/2004 :  09:49:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

Thanks. Appreciate the quick reply.
So datasets could be copied to vectors, vectors sorted and copied back?

I'm only just getting used to vectors (as opposed to datasets)!

Cheers,

pete

Go to Top of Page

hajo_old

Germany
141 Posts

Posted - 02/27/2004 :  10:12:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, Peter

Yep!

Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1 is now hajo
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/27/2004 :  10:15:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
So datasets could be copied to vectors, vectors sorted and copied back?
Dataset inherits vector properties and methods so you can sort the dataset itself. Copying to vector is unnecessary.

Mike Buess
Origin WebRing Member
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/27/2004 :  10:42:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Dataset inherits vector properties and methods so you can sort the dataset itself. Copying to vector is unnecessary.



Unfortunately, this is true only for numeric data. For strings from Text columns, you need to do copying by GetStringArray and PutStringArray.


CP


Go to Top of Page

peter.cook

UK
356 Posts

Posted - 03/01/2004 :  05:31:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi all,

Thanks for help.

I also think retrieving the original indeces is v useful.

Cheers,

pete



Edited by - peter.cook on 03/01/2004 06:04:22 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000