Could any "Lua guys" confirm my thoughts.

See the post-processor code line highlighted in red:

function OnInit()

offX = 0
offY = 0
offZ = 0

post.SetCommentChars (“()”, “”) --make sure ( and ) characters do not appear in system text
post.Text (" (Filename: “, fileName, “)\n”)
post.Text (” (Post processor: “, postName, “)\n”)
post.Text (” (Date: “, date, “)\n”)
if(scale == metric) then
post.Text (” G21 (Units: Metric)\n") --metric mode
post.Text (" G20 (Units: Inches)\n") --inch mode
post.Text (" F1\n G53 G90 G40\n")
minArcSize = 0.2 --arcs smaller than this are converted to moves
firstRef = refDistance >=0
currentZAxis = " Z"

dist = 9999999
lastz = 0
thcstate = 1
xPlus = false
yPlus = false
cX = 0
cY = 0

My thoughts are that is simply wrong, as “>=” means “is greater than or equal to”, and is normally used as a comparative test on a variable.
In this case however, it’s attempted use is to define a variable.
Isn’t that completely wrong ??

The comparison >= returns either true or false. Basically that line is setting the variable ‘firstRef’ to true if refDistance is greater than zero.

Thanks very much Les.

Well, that has taught me something new. I’ve read a few programming books, videos, etc and never seen that one.

I was quite sure the statement was wrong but something made me ask to confirm. Good job I did :stuck_out_tongue:

I guess I’ve never thought of comparative statements as “returning” a value of true or false.
I’ve simply been under the impression that if the comparison is true then…but never if the comparison returns a VALUE of true or false.

I see it in a whole different light now, and that statement takes on a whole new meaning. Much appreciated.