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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 sizeof StringArray?!

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Moritz.Kurka Posted - 06/18/2009 : 09:17:09 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
Moritz.Kurka Posted - 06/19/2009 : 04:06:48 AM
Oh indeed it does have a GetSize().
So shame on me and thank you both for your help
eparent Posted - 06/18/2009 : 11:26:03 AM
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.
easwar Posted - 06/18/2009 : 09:47:33 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000