To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 9295
9294  |  9296
Subject: 
Re: Mindstorms spirit.ocx programming = RCX ASM coding? (fwd)
Newsgroups: 
lugnet.robotics
Date: 
Thu, 23 Dec 1999 04:00:18 GMT
Original-From: 
Jim Choate <RAVAGE@EINSTEINspamless.SSZ.COM>
Viewed: 
612 times
  
----- Forwarded message from Dave Baum -----

From: dbaum@spambgoneenteract.com (Dave Baum)
Subject: Re: Mindstorms spirit.ocx programming = RCX ASM coding?
Date: Thu, 23 Dec 1999 02:44:41 GMT

Correct.  IMHO, calling this "programming the RCX in VB" is very
misleading.  None of the familiar VB features (variables, control
structures, etc) will run on the RCX.  For example, in order to construct
an "if" statment, you don't use the VB "if".  Instead you use a spirit.ocx
method called If() which takes as parameters the items to be comared and
the type of comparisson.  This gets pretty tedious.  Here's an example
taken from the SDK:

PBrickCtrl.If 2, 5, 2, 0, 15    | If (constant) 5 = variable 15 then
PBrickCtrl.PlayTone 440, 20     | play a 440 Hz tone for 200 ms.
PBrickCtrl.Else Else
PBrickCtrl.PlayTone 5000, 10    | play a 5000 Hz. tone with a 100 ms. duration
PBrickCtrl.EndIf                | Close the If...Else...EndIf control-structure.

I don't know about you, but I'd much rather do something like this:

if (x == 5)
  PlayTone(440, 20);
else
  PlayTone(5000, 10);

Don't even get me started on how you'd use spirit.ocx to do something like this:

if (x * 2 < y + 5)
  PlayTone(440, 20);

----- End of forwarded message from Dave Baum -----

This is why they make pre-processors.

    ____________________________________________________________________

           The best lack all conviction, while the worst are full
           of passionate intensity.

                                               W.B. Yeats

       The Armadillo Group       ,::////;::-.          James Choate
       Austin, Tx               /:'///// ``::>/|/      ravage@ssz.com
       www.ssz.com            .',  ||||    `/( e\      512-451-7087
                           -====~~mm-'`-```-mm --'-
    --------------------------------------------------------------------



Message has 1 Reply:
  Re: Mindstorms spirit.ocx programming = RCX ASM coding? (fwd)
 
(...) control-structure. (...) like this: (...) Preprocesors can make things a little less verbose and also assign readable names to constants. However, its quite another thing to convert infix notation to function calls or allocate temporary (...) (25 years ago, 23-Dec-99, to lugnet.robotics)

2 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