To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 96
95  |  97
Subject: 
Re: variables and spybot
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Mon, 9 Sep 2002 18:13:56 GMT
Viewed: 
5433 times
  
In lugnet.robotics.spybotics, John Hansen writes:
The other syntax I used was += and -= which are the most optimal means for
writing n = n + something or n = n - something.  There are also *=, /=, |=,
and &=.

Something tricky about MindScript is the way it handles whitespace around
certain things.  I just noticed that I had written:

n^= 0

in my program.  For a minute or two I was thinking that was using a ^=
operator on the variable n.  But there isn't a ^= operator (which might
mean, if it existed, not-equals or exclusive-or-equals).  The MindScript
compiler interprets all of the following identically:

n ^= 0
n ^ = 0
n^ = 0
n^= 0
n^=0

which compiles to:

set 36,-1,2,0
set 36,-1,2,0
set 36,-1,2,0
set 36,-1,2,0
set 36,-1,2,0

So be careful with your carets.

If you are interested in seeing the compiler output, by the way, you can add
-TRACE=15 to the Addition Switches via the Preferences dialog and then
examine the contents of the file vpbtrace.txt in the VPBrick2 subdirectory
under the Mindstorms SDK.

John Hansen
http://members.aol.com/johnbinder/bricxcc.htm



Message is in Reply To:
  Re: variables and spybot
 
(...) For reasons unknown to me the designers of MindScript decided to use array property notation much like that used in Delphi to implement various features in the Spybot firmware. world should not be thought of as a subroutine. It is a (...) (22 years ago, 9-Sep-02, to lugnet.robotics.spybotics)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR