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
 sizeof StringArray?!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Moritz.Kurka

Germany
11 Posts

Posted - 06/18/2009 :  09:17:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everyone,
i got probably the oldest problem in the world: i want to import multiple ascii files. Additionally i want to go through different folders and let the script search for all files with a certain extension.
What i found so far is the function FindFiles which seems to do what i want, namely returning to me all filenames with a certain extension (.txt in my case). The filenames themselves are returned in a StringArray (correct me if i'm wrong here). My problem starts at the point where i'm trying to find out how many files are found by FindFiles.
In C++ i would return everything to vector and just get the size of the vector which seems not to be possible in Origin, or?
I don't want to / can't use MultiOpenBox or whatever was the name of that thing since that would contradict my idea of saving time with the script because i would have to click myself through every folder.

So is there any way to get the size of a StringArray or are there more clever ways to solve my problem?

Thank you for your help.
Regards Moritz


Origin Ver.8 and Service Release 5
Operating System: Windows Vista

easwar

USA
1964 Posts

Posted - 06/18/2009 :  09:47:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Moritz,

If you look under Composite Data Types->string in the OC reference, you will see "An array of strings has been implemented using the following type definition: typedef vector<string> StringArray;"

So string array is type vector and derives methods and properties from vector and vectorbase, and vectorbase has .GetSize()

Easwar
OriginLab
Go to Top of Page

eparent

118 Posts

Posted - 06/18/2009 :  11:26:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Moritz,

I have created a StringArray example that you may find useful.
http://ocwiki.originlab.com/index.php?title=Category:Vector_%28class%29#Examples

Thanks.
Go to Top of Page

Moritz.Kurka

Germany
11 Posts

Posted - 06/19/2009 :  04:06:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Oh indeed it does have a GetSize().
So shame on me and thank you both for your help

Edited by - Moritz.Kurka on 06/19/2009 04:07:43 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