NXC: compile error using DrawLine

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

NXC: compile error using DrawLine

Post 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
#----------------------------------------------------------
hergipotter
Posts: 48
Joined: 12 Jan 2011, 18:40
Contact:

Re: NXC: compile error using DrawLine

Post 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
link to my youtube channel under my avatar!
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC: compile error using DrawLine

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: compile error using DrawLine

Post by HaWe »

sure, thx!
DrawLine, DrawRect, DrawCircle...: I think that was my former Pascal code :roll:
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests