Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / quick question regarding multiple commands on one line...

Author
Message
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Feb 2008 10:33
What is the difference between ; and :? Sometimes a ; doesn't work to add multiple code lines while a : does, when placed where a ; should go.

For example

Doesn't work, however,

does.

Thanks in advance
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Feb 2008 00:41
The only time I can think of using ; is with the PRINT command, it basically does the same as + when using the TEXT command, it doesn't define a new line, it adds to the command.
It's a bit stupid and needlessly confusing if you ask me. (but no doubt someone more experienced than me will come along with a hot-headed explanation of why it makes perfect sense )

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Feb 2008 02:52 Edited at: 17th Feb 2008 02:53
The colon [ : ] is a statement separator and should only be used to separate multiple statements on the same line.

The semi-colon [ ; ] is ONLY for use with the Print statement and is used to prevent a CR/LF (carriage return/line feed) which is automatically added to anything put on the screen using Print - and would normally drop the screen cursor down to the start of the next line ready for the next Print statement.

The use of ; allows you to print something on the screen at the end of whatever was printed last.

TDK_Man

Login to post a reply

Server time is: 2025-06-05 19:29:32
Your offset time is: 2025-06-05 19:29:32