Page 1 of 1

NXC: compile error using DrawLine

Posted: 08 Feb 2011, 16:23
by HaWe
hi,
I get a compile error with this code:

Code: Select all

int i, peak;
DrawLine ((i+1)/2, 0, (i+1)/2, peak);
I can't get a help example to Drawline but I assume its
DrawLine(x1,y1, x2,y2).

So what's wrong?
# Error: ';' expected
File "c:\temp\temp.nxc" ; line 47
# 15 ((
#----------------------------------------------------------
# Error: Invalid assignment
File "c:\temp\temp.nxc" ; line 47
# 15 ((i+1
#----------------------------------------------------------
# Error: ';' expected
File "c:\temp\temp.nxc" ; line 47
# 15 ((i+1
#----------------------------------------------------------

Re: NXC: compile error using DrawLine

Posted: 08 Feb 2011, 16:54
by hergipotter
Is there a function called DrawLine? I don't think so.
In the programmer's guide, there's only a constant named DrawLine

http://bricxcc.sourceforge.net/nbc/nxcd ... facdf65d74

Maybe you mean LineOut?
http://bricxcc.sourceforge.net/nbc/nxcd ... 2ad2fac759

Re: NXC: compile error using DrawLine

Posted: 08 Feb 2011, 16:57
by afanofosc
I'm just guessing here but I think the problem is that DrawLine is not an NXC API function. It is a constant equal to 15.

http://bricxcc.sourceforge.net/nbc/nxcd ... facdf65d74

LineOut might be the function you are looking for.

http://bricxcc.sourceforge.net/nbc/nxcd ... 2ad2fac759

Or you could use the SysDrawLine system call function.

http://bricxcc.sourceforge.net/nbc/nxcd ... c76d0b7dc8


edit: already answered above.

John Hansen

Re: NXC: compile error using DrawLine

Posted: 08 Feb 2011, 17:03
by HaWe
sure, thx!
DrawLine, DrawRect, DrawCircle...: I think that was my former Pascal code :roll: