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
Last Switch(Ruby)
19 posts
• Page 2 of 2 • 1, 2
Re: Last Switch(Ruby)
RJHollins wrote:Obviously, still struggling to get a handle on the basics of RUBY. I'm hitting those posted RUBY sites to get familiar. My only programming 'experience' was using GFABasic on the ATARI ST back in the 80's.
Ruby sites are great for info....but for me it seems to be better just experimenting in FS.
I only know a little VB..so i know how you feel..trying to get a grip on this ruby monster...not easy..
RJHollins wrote:... i, firstsignal, secondsignal
Sounds like you almost made a "selector" here, using that "i" input..
Try using a boolean signal for that "i" input....and you'll see that "def event" thing more clearly..
Small question mark on "Output 0,V" method....
What if different inputs arrive at exactly the same time...???
There's no instruction in the code for this...what will ruby do?
I'm guessing its so remote it's a non-issue...not sure...
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Last Switch(Ruby)
Just what i found out with ruby:
If you "add" ruby signals by linking them to the same Point a ruby Signal will not be added - It will "last-Switch"
I think this is great because it is much easier if you have to handle a lot of Switches
I created an example
Regards
If you "add" ruby signals by linking them to the same Point a ruby Signal will not be added - It will "last-Switch"
I think this is great because it is much easier if you have to handle a lot of Switches
I created an example
Regards
- Attachments
-
- DATA_Switch_ruby.fsm
- Ruby DATA last Switch example
- (499 Bytes) Downloaded 888 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
-
chackl - Posts: 233
- Joined: Tue Aug 17, 2010 8:46 pm
- Location: Austria / Salzburg
Re: Last Switch(Ruby)
Thanks for the RUBY example chackl.
Just being made aware of different possibilities helps
Just being made aware of different possibilities helps
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Last Switch(Ruby)
chackl wrote:I created an example
So now were down to "output @in"...cool...
I'm glad i never showed some of earlier attempts at it
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Last Switch(Ruby)
billv wrote:chackl wrote:I created an example
So now were down to "output @in"...cool...
I'm glad i never showed some of earlier attempts at it
Just for your (personal) Note:
It is working and it is simple
If you do have any problems with it - DO NOT USE IT OR DO NOT MIND!
Or: CREATE SOMETHING BETTER
But please keep your useless advices for yourself or go to Facebook with that ^^
EDIT:
Sorry for those hard word - You are right it is NOT the developement of century ^^
This Example is should just to show how FlowStone calculates ruby-links.
Regards
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
-
chackl - Posts: 233
- Joined: Tue Aug 17, 2010 8:46 pm
- Location: Austria / Salzburg
Re: Last Switch(Ruby)
Hi Chackl,
Please, I think you totally miss read Billv response
The evolution of this 'Last Switch' code is now down to a single line ... that is some optimization !
Personally, I've had similar 'shock' as a piece of RUBY code that I've been working on ... and then see one of the GURU's reduce it down to a few statements ....
I've NOT wanted to post my version in comparison.
Please, I think you totally miss read Billv response
The evolution of this 'Last Switch' code is now down to a single line ... that is some optimization !
Personally, I've had similar 'shock' as a piece of RUBY code that I've been working on ... and then see one of the GURU's reduce it down to a few statements ....
I've NOT wanted to post my version in comparison.
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Last Switch(Ruby)
Sorry i read it a Little like "What do you want here..."
Sorry again - But since that there are thoes facebookkiddies are all over the Internet, you get also more "trash"-Help or comments on goog sites
Never mind - As an excusement i have another example here
With ruby you are not eaven able to Switch data very easy - you are also able to find out where the data came from
Here we are
This code Outputs als conected data to an Array - just one more letter ^^
Sorry again
Regards
Sorry again - But since that there are thoes facebookkiddies are all over the Internet, you get also more "trash"-Help or comments on goog sites
Never mind - As an excusement i have another example here
With ruby you are not eaven able to Switch data very easy - you are also able to find out where the data came from
Here we are
- Code: Select all
output @ins
This code Outputs als conected data to an Array - just one more letter ^^
Sorry again
Regards
- Attachments
-
- switch_data_text.fsm
- (8.17 KiB) Downloaded 856 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
-
chackl - Posts: 233
- Joined: Tue Aug 17, 2010 8:46 pm
- Location: Austria / Salzburg
Re: Last Switch(Ruby)
chackl wrote:Sorry i read it a Little like "What do you want here.
Forget it...you've just miss interpreted..apology accepted
billv wrote:So now were down to "output @in"...cool...
Thats just me saying "Great, the code has been simplified even more"
The "cool" statement can be defined in context as "happy,content or impressed"
billv wrote:I'm glad i never showed some of earlier attempts at it
This line pays respect to the creator(s) of these simplified codes, by indicating how bad
my earlier attempts were.
Thanks for latest example...
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Last Switch(Ruby)
These are the type of CODE examples that I want to put into the 'Code Librarian' that one of the GURUs posted here for the 'ToolBox'.
Great stuff !
Great stuff !
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
19 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 60 guests