LEGO mindstorms NXT power programming: robotics in C

News, rumors, and other broad discussion topics.
m-goldberg
Posts: 73
Joined: 29 Sep 2010, 12:05

Re: LEGO mindstorms NXT power programming: robotics in C

Post by m-goldberg »

mattallen37 wrote:I think sub is basically identical in function to void, but it is not as efficient, IIRC.
'sub' is an exact synonym of 'void' IIRC. 'sub' is simply an inheritance from NQC, which did not have 'void'.
Regards, Morton
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: LEGO mindstorms NXT power programming: robotics in C

Post by muntoo »

m-goldberg wrote:
mattallen37 wrote:I think sub is basically identical in function to void, but it is not as efficient, IIRC.
'sub' is an exact synonym of 'void' IIRC. 'sub' is simply an inheritance from NQC, which did not have 'void'.
Everyone uses "void", because that's what C/C++ have.
No one uses "sub" which used to be part of NQC, and is "deprecated".
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
borntoown
Posts: 58
Joined: 14 Nov 2010, 16:58

Re: LEGO mindstorms NXT power programming: robotics in C

Post by borntoown »

Thanks again;
mattallen37 wrote: Well, then please explain what you mean by "files". do you mean the general concept of files on a computer? If you are referring to the file system on the NXT (reading and writing files with an NXC program), then I don't think you are ready to try to understand how to do it.
Yes, I meant the file system on the NXT. You can explain it, and I'll see (Because as I said, I don't make a program without it).

Thanks,
B2O.
B2O productions are the best for the best.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: LEGO mindstorms NXT power programming: robotics in C

Post by mattallen37 »

As far as the whole thing with sub vs. void, I am sure there was SOME reason that void is the better one (not just because of being "standard").

In regard to the file system, I don't know a whole lot (I have only used it in maybe 10 or so simple cases). To post any example, I'll have to wait until I am using the computer that I program on.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: LEGO mindstorms NXT power programming: robotics in C

Post by muntoo »

mattallen37 wrote:As far as the whole thing with sub vs. void, I am sure there was SOME reason that void is the better one (not just because of being "standard").
We can argue about it all day, but I know John once said:
John Hansen when he was apprenticed to Yoda wrote:Void is emptiness. The alias of void is sub. Nothing more, but the remnants of NQC.
sub exists as backward compatibility with NQC. It's probably defined like this:

Code: Select all

#define sub void
OR this:

Code: Select all

typedef void sub
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: LEGO mindstorms NXT power programming: robotics in C

Post by afanofosc »

sub == void. Simply in NXC for the sake of NQC familiarity/compatibility.

If you want to write code that is as like C as NXC can be then you should not use sub.

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: LEGO mindstorms NXT power programming: robotics in C

Post by mattallen37 »

Okay, thanks for clarifying.
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: Ahrefs [Bot] and 0 guests