LINE--is it a function or something misterious hack?

New to FreeBASIC? Post your questions here.
Post Reply
PeterHu
Posts: 145
Joined: Jul 24, 2022 4:57

LINE--is it a function or something misterious hack?

Post by PeterHu »

From the manual:

Code: Select all

'' draws a diagonal red line with a white box, and waits for 3 seconds
Screen 13
Line (20, 20)-(300, 180), 4
Line (140, 80)-(180, 120), 15, b
Line - ( 200, 200 ), 15
Sleep 3000
Playing with adding parentheses won't compile,so it seems it is not a function or sub,then what is it?

Code: Select all

'wrong code--
Line ((20, 20)-(300, 180), 4)
From c family poor knowledge got,I am just confused,where are line/circle... come from.

Thanks in advance.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: LINE--is it a function or something misterious hack?

Post by paul doe »

It is both: internally, it's a function. But BASIC was defined like that, so that's how you need to call it. This is one of many so called 'quirk' statements, that need special parsing. BASIC syntax, you know... :roll:
PeterHu
Posts: 145
Joined: Jul 24, 2022 4:57

Re: LINE--is it a function or something misterious hack?

Post by PeterHu »

paul doe wrote: Apr 03, 2023 4:22 It is both: internally, it's a function. But BASIC was defined like that, so that's how you need to call it. This is one of many so called 'quirk' statements, that need special parsing. BASIC syntax, you know... :roll:
Just got it,thank you!
Post Reply