Is there no min() function in ebasic?

Michiel Sovijarvi-Spape mspape at cognitology.eu
Tue Jul 10 14:23:40 UTC 2012


Hi,

It can be really quite useful to clean up some code, especially if you write
a lot of these long statements. I also use it a lot for the code-intensive
parts i reuse between experiments, such as making random noise masks with
some canvas-code because, quite often, I am really just too lazy to look up
exactly how one goes about doing these things.

Cheers,

Mich

 

From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf
Of Christopher Chatham
Sent: 10 July 2012 16:02
To: e-prime at googlegroups.com
Subject: Re: Is there no min() function in ebasic?

 

Yes, rock on! 

I wasn't aware that we could implement functions of this kind. Thank you
very much.
-Chris

On Tue, Jul 10, 2012 at 8:41 AM, Michiel Sovijarvi-Spape
<mspape at cognitology.eu> wrote:

Hi,

Like you, I thought, that is pretty odd, but you seem correct anyway.
Nonetheless, there's an argument to be made against packing all sorts of
superfluous operations in a programming language (like VBA), if you're not
using them and are easily able to add them yourself. So, just add to your
user script:

 

Function min(inx As Variant, iny As Variant) As Variant

      If inx < iny Then min = inx Else min = iny      

End Function

 

Now, writing 

TextDisplay1.Text = min(5,3) 

for example, will show "3". Rock on, no?

Best,

Mich

 

 

 

From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf
Of Chris
Sent: 10 July 2012 13:57
To: e-prime at googlegroups.com
Subject: Is there no min() function in ebasic?

 

I realize I must be overlooking something, but I cannot find the minimum
function.  If I just want the smaller of two variables, do I really have to
construct an if statement for that? 

I realize that I can also put them in a summation object and use
summation.min; or I could put them in an array and sort it; but surely the
min() function must exist, right? 

-- 
You received this message because you are subscribed to the Google Groups
"E-Prime" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/e-prime/-/vVI7xbobw3YJ.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to
e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/e-prime?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to
e-prime+unsubscribe at googlegroups.com
<mailto:e-prime%2Bunsubscribe at googlegroups.com> .
For more options, visit this group at
http://groups.google.com/group/e-prime?hl=en.

 

-- 
You received this message because you are subscribed to the Google Groups
"E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to
e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/e-prime?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120710/7b0bb128/attachment.htm>


More information about the Eprime mailing list