To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 978
977  |  979
Subject: 
How to read variables from RCX
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 14 Feb 2001 04:12:42 GMT
Viewed: 
1988 times
  
It is my understanding that the RCX has 32 "spaces" for variables, I am
trying to set variable A or 10 to the value of 100 and then evaluate it in
an IF statement. However I am not sure how to read that variable "space"
correctly. Here is what I am trying to do in a snippet of code.

int A;
task main(){
  if(A == 100){
    start sometask;
  }else{
    start someothertask;
  }


I would think that there would be a certain way to call that variable
"space" properly and as I do know that the "spaces" are 0-9 and A-G I don't
think that I can call "A" as I am doing above because I initialize "A" but
never set it to any value (because I am trying to pass that value to the
program) so the IF always evaluates false and runs the else.

Your help would be GREATLY appreciated, please respond to my e-mail address
below as well as posting your reply.

Chris
mixer4663@home.com



Message has 1 Reply:
  Re: How to read variables from RCX
 
(...) In general, you don't have control over where the variables get placed. If necessary you can take advantage of the fact that globals are allocated consecutively starting at location 0, so in the above example, A refers to location 0. However, (...) (24 years ago, 14-Feb-01, to lugnet.robotics.rcx.nqc)

4 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