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
ifthenelse for arrays in ruby?
20 posts
• Page 2 of 2 • 1, 2
Re: ifthenelse for arrays in ruby?
What do you mean by ranges? It works for strings too:
- Attachments
-
- Schematic1_new.fsm
- (594 Bytes) Downloaded 774 times
- TheOm
- Posts: 103
- Joined: Tue Jan 28, 2014 7:35 pm
- Location: Germany
Re: ifthenelse for arrays in ruby?
Thanks!
By ranges - let say that I'm not a good rubyist.
By ranges - let say that I'm not a good rubyist.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
Small problem. If I change the input type from "string array" into "int array" - ruby module no longer works (empty ouptuts). Can this be fixed, so that there is no need to use text primitive between nodes?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
you mean this?
- Attachments
-
- battle_tester_vs_ruby.fsm
- (602 Bytes) Downloaded 819 times
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: ifthenelse for arrays in ruby?
Yes, thanks.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
Tronic wrote:you mean this?
haven't checked the fsm ... but the file title gave a chuckle
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: ifthenelse for arrays in ruby?
It took me two minutes to realize the difference. Quotation marks.
I'm in the middle of heavy brainstorming. Creating a cookbook according to TCM - yet another unusual application of FS. (yep, I hear these voices - definately with x64 cooking would be 2x faster ).
I'm in the middle of heavy brainstorming. Creating a cookbook according to TCM - yet another unusual application of FS. (yep, I hear these voices - definately with x64 cooking would be 2x faster ).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
I have one more thing.
I'd like to convert one bigger array according to rules stored in two smaller arrays. Like this.
input array:
el1
el2
el3
el1
el3
contitions arrays ("=" separated to make it more readable; can be in two independent text files or like this):
el1=element1
el2=element2
el3=somethingelse
el4=andsomethingelsemore
output would be then like this:
element1
element2
element3
element1
element3
How?
I'd like to convert one bigger array according to rules stored in two smaller arrays. Like this.
input array:
el1
el2
el3
el1
el3
contitions arrays ("=" separated to make it more readable; can be in two independent text files or like this):
el1=element1
el2=element2
el3=somethingelse
el4=andsomethingelsemore
output would be then like this:
element1
element2
element3
element1
element3
How?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
Combine your condition arrays into a Hash.
Then map the input array to the output using that Hash.
Then map the input array to the output using that Hash.
- Attachments
-
- hash.fsm
- (459 Bytes) Downloaded 808 times
- TheOm
- Posts: 103
- Joined: Tue Jan 28, 2014 7:35 pm
- Location: Germany
Re: ifthenelse for arrays in ruby?
Thank you!
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
20 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 44 guests