Welcome! Log In Create A New Profile

Advanced

Remarks are ; surely we should use // or /* */

Posted by stephen george 
Remarks are ; surely we should use // or /* */
October 31, 2009 01:56AM
Guys,

Going through the firmware code and it looks like the code is using ; as a remark.
Surely we should be following the C convention of // or /* and */.

; is a line terminator in C and PL/SQL

regards

Stephen


Here is the code in question in process_string


//newlines are ends of commands.
if (c != '\n')
{
// Start of comment - ignore any bytes received from now on
if (c == ';')
comment = true;

// If we're not in comment mode, add it to our array.
if (!comment)
cmdbuffer[serial_count++] = c;
}
emt
Re: Remarks are ; surely we should use // or /* */
October 31, 2009 04:31AM
That refers to a comment in the G code string from the host/ terminal. The code tells the parser to ignore it.


G01 X500. F100 ; This line moves X 500mm at 100mm a minute


Regards

Ian
Re: Remarks are ; surely we should use // or /* */
October 31, 2009 08:40PM
Ian

> That refers to a comment in the G code string from the host/ terminal. The code tells the parser to ignore it.

Yep I see that but shouldn't that be

G01 X500. F100 // This line moves X 500mm at 100mm a minute

Rather than

G01 X500. F100 ; This line moves X 500mm at 100mm a minute

Stephen
emt
Re: Remarks are ; surely we should use // or /* */
November 01, 2009 04:39AM
No because it is part of the de facto G code standard for machine tool control that has been around since the early sixties.


Regards

Ian
Re: Remarks are ; surely we should use // or /* */
November 01, 2009 04:55PM
>No because it is part of the de facto G code standard for machine tool control that has been around since the early sixties.

Wow I though g codes was a reprap invention. Thanks for the heads up

Stephen
Sorry, only registered users may post in this forum.

Click here to login