Page 27 of 27
Re: Combination Circuits/Schematics
Posted: Fri Aug 23, 2019 8:54 am
by RJHollins
Ahh ... OK ... I understand better.
What threw me was the STRING output of the convert Boolean ... well, the choices in the Ruby module I see now as separate equations formulas.
Thanks Tiffy
Re: Combination Circuits/Schematics
Posted: Fri Aug 23, 2019 9:30 am
by tiffy
CONVERT ANY VALUE TO A BOOLEAN v1.2 (RUBY).
Here is an example of v1.2 that will eliminate the unwanted Triggers at the Output Terminal.
Re: Combination Circuits/Schematics
Posted: Fri Aug 23, 2019 3:30 pm
by wlangfor@uoguelph.ca
tiffy wrote:CONVERT ANY VALUE TO A BOOLEAN v1.2 (RUBY).
Here is an example of v1.2 that will eliminate the unwanted Triggers at the Output Terminal.
An interesting idea, thanks.
Re: Combination Circuits/Schematics
Posted: Fri Aug 23, 2019 7:45 pm
by trogluddite
tiffy wrote:With the first two raw examples, I only wanted to put forward the idea in the hope that the more competent Ruby programmers will / can take it a step or two further in some practical examples and also share some of their practical ideas on this.
More of an observation than an example - that with the addition of Ruby, FlowStone now has three different definitions of what a boolean is! In 'green', zero = false and non-zero (but usually one) = true, but in DSP/Assembly, zero is still false, but true is an "all-bits" bitmask that isn't even a real number. And now, in Ruby, only nil/false are false, and absolutely anything else counts as true!
I must admit that when sending a value to a RubyEdit boolean output, the way that the value is translated almost as if it's a 'green' value caught me out a few times - I expected that it would just use the Ruby definition (equivalent to the !!-trick.)
Maybe worth pointing out too, that
within Ruby code (i.e. not when sending to an output), you very rarely need the !!-trick. For control statements like
if,
unless,
while,
until, the conversion is always implied - so people shouldn't panic and go through all their Ruby code adding lots of exclamation marks. However, when you're expecting a boolean RubyEdit output to do what you want, or absolutely need true/false in the code, it's very handy indeed!
Re: Combination Circuits/Schematics
Posted: Sat Aug 24, 2019 3:41 pm
by tiffy
Quote: "Maybe worth pointing out too,... - so people shouldn't panic and go through all their Ruby code adding lots of exclamation marks. However, when you're expecting a boolean RubyEdit output to do what you want, or absolutely need true/false in the code, it's very handy indeed!"
I had a problem getting the first MP3 file, which has the index 0, in a player to load from a list in the player into the queue. All the other files would load correctly except for the first file in the list. Then, I used the "!!-trick" for this purpose in order to get a trigger from the 0-indexed file. Maybe my ignorance but I do not know another way of doing this. Therefore, I upload the "!!-trick" in case someone else may need it too.
Re: Combination Circuits/Schematics
Posted: Thu Feb 20, 2020 5:59 am
by yoye
tiffy wrote:SIMPLE CALCULATOR (Picture Only):
I made this simple calculator which supports working with two decimal numbers but it can only do one calculation at a time. All the functions on the keyboard are functional...however, no fancy glitter like multiple stack or continuous memory etc.
Please ask for help
I need a calculator file. To do education for my students. Thank you.