Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

counting strings on array

For general discussion related FlowStone

counting strings on array

Postby tester » Mon Oct 28, 2013 1:20 am

If I have a string array (with long textual strings; thus - ruby), I'd like to count - how many lines are not empty. Like this:

---------
text
text

text


text

---------

In general - there are 8 lines on that array, but not empty - only four. How to detect them? I guess it should be some simple formula for empty lines removal, and then measurement via int primitive connected to array out. Or...?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: counting strings on array

Postby chackl » Mon Oct 28, 2013 8:09 am

Not a Primitive but you could do that in ruby very simple ;)

Regards
Attachments
count array.fsm
(462 Bytes) Downloaded 734 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: counting strings on array

Postby tester » Mon Oct 28, 2013 12:33 pm

Thanks.

Actually, some things I'm doing right now - require ruby instead of regular green prims, because ruby deals on the fly with arrays, while green prim based solutions are veeeery sluggish. Though - there are still things, that I prefer to rely on green wiring. I guess it's a matter of precising (in FS environment) - which things should be done with ruby, and which should not (the rest of the party can be done with it, but does not have to). And I guess for most folks there is no difference anyway. ;-)

I guess Trog is very happy, that I started to use ruby. :mrgreen: :ugeek:
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet


Return to General

Who is online

Users browsing this forum: Google [Bot] and 55 guests