RCX NQC variable types

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

RCX NQC variable types

Post by mattallen37 »

What different types of variables are available in NQC? I know "int" is, but that seems to be the only one. Is it?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: RCX NQC variable types

Post by afanofosc »

The RCX firmware supports only one variable type so NQC only gives you one type. 16 bit signed integers using the "int" keyword. You do have access also to arrays of int and int pointers if you use the RCX 2.0 firmware and the latest NQC compiler.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX NQC variable types

Post by mattallen37 »

Ok, that is what I suspected. Thanks. What are int pointers?

Matt
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: RCX NQC variable types

Post by mightor »

Int pointers are pointers to ints :) Basically, instead of a memory location holding a value like "100", it holds the value of a memory location of another variable. Everything you wanted to know about pointers but were afraid to ask: http://pw1.netcom.com/~tjensen/ptr/pointers.htm

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX NQC variable types

Post by mattallen37 »

Ok, I think I understand now. Thanks.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: RCX NQC variable types

Post by mightor »

Pointers are an awesome way of messing up your program in fantastic and unpredictable ways that are almost impossible to debug.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX NQC variable types

Post by mattallen37 »

LOL. I can see that in theory, that could be very true.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest