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
How to remove empty items
11 posts
• Page 1 of 2 • 1, 2
How to remove empty items
I'm building a semi modular effect. The user can select an effect on every slot, but when an effect is chosen, then in the other effect slot must the effect removed. I'd build some logic, but I have empty places. How can I remove them?
See my schematic
See my schematic
-
Yuroun - Posts: 27
- Joined: Mon Dec 19, 2011 7:32 pm
- Location: Tilburg, The Nethlands
Re: How to remove empty items
I found some ruby code online. Seems to work. Try out the attached module.
- Attachments
-
- SelectFX2.fsm
- (2.37 KiB) Downloaded 1029 times
- briant1972
- Posts: 9
- Joined: Mon Jun 11, 2012 4:23 am
Re: How to remove empty items
Hi Yuroun
I would do it like below, all one line and no extra bits required
output @SourceString.gsub(@OldPattern,@NewPattern).each_line.reject{|x| x.strip == ""}.join
Best Regards
I would do it like below, all one line and no extra bits required
output @SourceString.gsub(@OldPattern,@NewPattern).each_line.reject{|x| x.strip == ""}.join
Best Regards
- Jay
- Posts: 276
- Joined: Tue Jul 13, 2010 5:42 pm
Re: How to remove empty items
Thanks Guys. Both are elegant solutions. I prefer the version of Jay. He modified my Ruby code nicest
-
Yuroun - Posts: 27
- Joined: Mon Dec 19, 2011 7:32 pm
- Location: Tilburg, The Nethlands
Re: How to remove empty items
Why thank you Yuroun!
glad it is of use for you m8
Best regards
glad it is of use for you m8
Best regards
- Jay
- Posts: 276
- Joined: Tue Jul 13, 2010 5:42 pm
Re: How to remove empty items
Jay wrote:Why thank you Yuroun!
Because it's a normal thing to do, If you get some help.
For me it is
Last edited by Yuroun on Thu Apr 11, 2013 10:03 am, edited 1 time in total.
-
Yuroun - Posts: 27
- Joined: Mon Dec 19, 2011 7:32 pm
- Location: Tilburg, The Nethlands
Re: How to remove empty items
It's a mannerism in English Yuroun 8D
Or was that a good for a pun?
hehe
Or was that a good for a pun?
hehe
-
nix - Posts: 817
- Joined: Tue Jul 13, 2010 10:51 am
Re: How to remove empty items
nix wrote:It's a mannerism in English Yuroun 8D
Or was that a good for a pun?
hehe
Lol
-
Yuroun - Posts: 27
- Joined: Mon Dec 19, 2011 7:32 pm
- Location: Tilburg, The Nethlands
Re: How to remove empty items
Here's the version I had in mind. It's not working perfectly
-
Yuroun - Posts: 27
- Joined: Mon Dec 19, 2011 7:32 pm
- Location: Tilburg, The Nethlands
Re: How to remove empty items
yeh its just a saying Yuroun a bit like "well thank you very much"
I see what you mean about not working perfectly, it seems the last column does not always update properly, I will have a look at it and see what i can come up with
Best Regards
I see what you mean about not working perfectly, it seems the last column does not always update properly, I will have a look at it and see what i can come up with
Best Regards
- Jay
- Posts: 276
- Joined: Tue Jul 13, 2010 5:42 pm
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 47 guests