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

How to remove empty items

For general discussion related FlowStone

How to remove empty items

Postby Yuroun » Tue Apr 09, 2013 11:43 pm

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
select-fx.png
select-fx.png (50.42 KiB) Viewed 20385 times

SelectFX.fsm
(2.14 KiB) Downloaded 1022 times
User avatar
Yuroun
 
Posts: 27
Joined: Mon Dec 19, 2011 7:32 pm
Location: Tilburg, The Nethlands

Re: How to remove empty items

Postby briant1972 » Wed Apr 10, 2013 2:07 am

I found some ruby code online. Seems to work. Try out the attached module.
Attachments
SelectFX2.fsm
(2.37 KiB) Downloaded 1030 times
briant1972
 
Posts: 9
Joined: Mon Jun 11, 2012 4:23 am

Re: How to remove empty items

Postby Jay » Wed Apr 10, 2013 2:13 am

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

SelectFX remove empty.fsm
(2.24 KiB) Downloaded 1051 times


Best Regards
Jay
 
Posts: 276
Joined: Tue Jul 13, 2010 5:42 pm

Re: How to remove empty items

Postby Yuroun » Wed Apr 10, 2013 3:28 pm

Thanks Guys. Both are elegant solutions. I prefer the version of Jay. He modified my Ruby code nicest ;)
User avatar
Yuroun
 
Posts: 27
Joined: Mon Dec 19, 2011 7:32 pm
Location: Tilburg, The Nethlands

Re: How to remove empty items

Postby Jay » Wed Apr 10, 2013 5:04 pm

Why thank you Yuroun!

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

Postby Yuroun » Thu Apr 11, 2013 8:56 am

Jay wrote:Why thank you Yuroun!



Because it's a normal thing to do, If you get some help.

For me it is :D
Last edited by Yuroun on Thu Apr 11, 2013 10:03 am, edited 1 time in total.
User avatar
Yuroun
 
Posts: 27
Joined: Mon Dec 19, 2011 7:32 pm
Location: Tilburg, The Nethlands

Re: How to remove empty items

Postby nix » Thu Apr 11, 2013 9:20 am

It's a mannerism in English Yuroun 8D
Or was that a good for a pun?
hehe
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: How to remove empty items

Postby Yuroun » Thu Apr 11, 2013 4:38 pm

nix wrote:It's a mannerism in English Yuroun 8D
Or was that a good for a pun?
hehe


Lol :lol:
User avatar
Yuroun
 
Posts: 27
Joined: Mon Dec 19, 2011 7:32 pm
Location: Tilburg, The Nethlands

Re: How to remove empty items

Postby Yuroun » Thu Apr 11, 2013 5:34 pm

Here's the version I had in mind. It's not working perfectly :roll:

SelectFX.fsm
(2.55 KiB) Downloaded 1039 times
User avatar
Yuroun
 
Posts: 27
Joined: Mon Dec 19, 2011 7:32 pm
Location: Tilburg, The Nethlands

Re: How to remove empty items

Postby Jay » Thu Apr 11, 2013 7:14 pm

yeh its just a saying Yuroun :D 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
Jay
 
Posts: 276
Joined: Tue Jul 13, 2010 5:42 pm

Next

Return to General

Who is online

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