How to make line numbers start at zero.

Having problems with or questions about SheetCam? Post them here.
Post Reply
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

How to make line numbers start at zero.

Post by mancavedweller »

I've modified my post processor to make line numbers increment by 1 instead of 10.

However, the line numbers start at 10 instead of 0.

I changed this:

function OnNewLine()
post.Text ("N")
post.Number (lineNumber, "0000")
lineNumber = lineNumber + 10
end


to this:

function OnNewLine()
post.Text ("N")
post.Number (lineNumber, "0000")
lineNumber = lineNumber + 1
end


which made the lines increment by 1, but no idea how to get them to start at zero.[/code]

Here's the start of the code:

N0010 (Filename: BOLT TAB.tap)
N0011 (Post processor: NeuronThcUccncPost (BEEFY).scpost)
N0012 (Date: 28/12/2017)
N0013 G90
N0014 F1
N0015 (Part: BOLT TAB)
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

Add this as the first line of function OnInit()

Code: Select all

lineNumber = 0
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Re: How to make line numbers start at zero.

Post by mancavedweller »

Thanks Les,

the reason I'm doing this is so the gcode line numbers match the way my cnc controller reads them.

Keith.
Post Reply