Equal to or more than ?

Michiel Spape Michiel.Spape at nottingham.ac.uk
Tue Sep 28 16:54:20 UTC 2010


Hi,
I'd like to voice my agreement with the sentiments expressed below: a short introduction to computer programming is of immense help for any modern scientist. 

That said, I think the question was rather odd and not wholly answered: E-Prime does not accept unequal? Not to accuse you of anything, but it sounds highly likely that your (not included) syntax must be wrong, or there's something very wrong with your E-Prime installation, since it _does_ accept said operator. Make a new experiment, and add the following inline:

dim i,j as integer
i = "this works"
j = "this doesn't"

Run and... Sorry, that was actually for someone else who used the above syntax. Note that the awkward Ebasic syntax makes i a variant, and j an integer. Delete this, now add the following instead:
dim i as integer
i = 3
if i <> 4 then debug.print "i is unequal to 3 since i equals " & cstr(i)
if i <> 2 then debug.print "i is unequal to 2 since i equals " & cstr(i)
if i = 3 then debug.print "i is equal to 3."
if not(i <> "3") then debug.print "i is not unequal to '3'. What?"

As you see, <> works fine. Notice that each if statement is true even though it means eBasic converts "3" into 3. Normal programming languages would not swallow this so easily, but VB does (some might but blatantly say 3 <> "3", therefore false). Notice that my example ends with the difficult to comprehend "not(i <> 3)". This is exactly what I expect is wrong in your code: make it logically too difficult for yourself and you - not EPrime - will sooner or later make errors. There are some very fine Aristotelian syllogisms that can obfuscate the most obvious truth.

Cheers,
Mich

PS: neat trick typewriter-wise, David! Perhaps you should have one of these: http://steampunkworkshop.com/images/Kb41.jpg


Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
www.cognitology.eu

-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of David McFarlane
Sent: 28 September 2010 15:18
To: e-prime at googlegroups.com
Subject: Re: Equal to or more than ?

Jayne,

Hmm.  Let's start with the advice that you don't want to hear and 
that others here are tired of hearing me say:  You need to take a 
class in Introduction to Computer Programming.  If you had done that 
then you would already know the answer to such a fundamental 
question, and your not knowing that tells me that, even if you make 
it over this one hurdle, you are just heading into deeper and deeper 
frustration the further you go unless you step back and get a proper education.

Nevertheless, I will address your specific question (without even 
looking at your specific code):  In E-Basic (i.e., Visual Basic), the 
token "<>" means "does not equal"; since ASCII plain text does not 
contain an actual "not equal to" symbol (just as the typewriters that 
preceeded computers had no such symbol because you could simply type 
"=", backspace, and then add the "/"; and yes, I do go back that 
far), mnemonically you should think that x cannot be simultaneously < 
y and > y, thus x <> y must mean x does not equal y.  (By contrast, 
in the language C you would write x != y.)

So, you cannot simply test for y1 < x < y2 in that compact symbolic 
form, or however you tried to do it with <> (you did not give us any 
example).  Instead, you must expand that into two clauses joined by a 
logical operator, thus,

If (y1 < x) and (x < y2) Then ...

That's it.  Now go sign up for a class where you would learn all this properly.

-- David McFarlane, Professional Faultfinder


>I am writing script for a behavioural experiment, whereby 12 triangles
>are presented together. I have a problem with the triangles
>overlapping each other on the screen. I would like to write some
>script to assign each triangle to a matrix where the triangle can move
>randomly within those specific co ordinates. I need to be able to
>write in the script for the co ordinates to be more than or less than
>a specific value. However, E-prime is not accepting the symbol <> and
>is asking me to set a parameter name or parameter?
>
>  See general script below without <>;
>
>(note that I only have 6 images scripted so far)
>
>  dim x1,y1 as integer
>x1 = random (30,190)
>y1 = random (30,190)
>c.SetAttrib "posx1", x1
>c.SetAttrib "posy1", y1
>dim x2,y2 as integer
>x2 = random (30,190)
>y2 = random (220,380)
>c.SetAttrib "posx2", x2
>c.SetAttrib "posy2", y2
>dim x3,y3 as integer
>x1 = random (30,190)
>y1 = random (410,570)
>c.SetAttrib "posx3", x3
>c.SetAttrib "posy3", y3
>dim x4,y4 as integer
>x4 = random (30,190)
>y4 = random (600,760)
>c.SetAttrib "posx4", x4
>c.SetAttrib "posy4", y4
>dim x5,y5 as integer
>x5 = random (220,380)
>y5 = random (30,190)
>c.SetAttrib "posx5", x5
>c.SetAttrib "posy5", y5
>dim x6,y6 as integer
>x6 = random (220,380)
>y6 = random (220,380)
>c.SetAttrib "posx6", x6
>c.SetAttrib "posy6", y6
>
>Any help would be much appreciated
>
>Many thanks,
>
>Jayne Morriss

-- 
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.

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

-- 
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.



More information about the Eprime mailing list