Qbasicnews.com
April 12, 2021, 06:47:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2 3
  Print  
Author Topic: multi-line REM ?  (Read 10401 times)
Poly Progr@ms
New Member

Posts: 7


WWW
« on: May 04, 2005, 08:17:33 AM »

hi yall

how do I make a multi-line rem (or ') in freebasic ? it lacks in qbasic and i hope you thought of it before me Wink.
Logged

reeBASIC, our future in here.
SSC
Guru
**
Posts: 288



WWW
« Reply #1 on: May 04, 2005, 08:26:43 AM »

Multi line rem? just create a new rem for each line you need

Code:
'this is rem 1
'this is rem 2
'and so on
Logged

url=http://www.smithcosoft.com]SmithcoSoft Creations[/url]
"If you make it idiot proof, someone will make a better idiot" - Murphy's Law
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #2 on: May 04, 2005, 08:39:24 AM »

And to comment out several lines of code:

Code:

#IF 0
  code
#ENDIF

 

Hehe... I see people at Progboards starts to be interested in FB...
Logged

Antoni
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #3 on: May 04, 2005, 08:55:24 AM »

Url? @ Antoni?
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #4 on: May 04, 2005, 08:59:46 AM »

What URL? Progboards?: http://www.progboards.com/
Logged

Antoni
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #5 on: May 04, 2005, 09:09:30 AM »

That's francais :*(
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #6 on: May 04, 2005, 10:49:32 AM »

Bien sur!
Logged

Antoni
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #7 on: May 04, 2005, 06:28:55 PM »

Online French-English Dict
 :rotfl:
Logged

i]"But...it was so beautifully done"[/i]
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #8 on: May 04, 2005, 06:56:31 PM »

I was going to add

Code:
comment
...
...
end comment


But i'm not sure if "comment" could become a reserved word, that would clash with old sources.. dunno.. the preprocessor "trick" Antoni showed does the same job.
Logged

Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #9 on: May 04, 2005, 07:04:46 PM »

Why not use #comment, or better yet, REM TO...END REM, or REM_ and make that crappy used-up keyword worth something.  That's all preprocessor stuff anyway.
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #10 on: May 04, 2005, 07:37:47 PM »

Code:
first executed code
#rem code code code
 code code
code code code

code

code code code

code
#rem code(this is also remed out!)
second executed code



Start ignoring from the first #rem, until it hits another #rem



No need for multiple new keywords cluttering...
Logged
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #11 on: May 04, 2005, 07:45:01 PM »

#if 0 works just fine; why invent a new keyword?  Besides, a row of single quotes (') down the left side of a long comment makes it easier to pick out from actual code.
Logged
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #12 on: May 04, 2005, 08:14:41 PM »

Readability.  A different face on it would help beginners read existing code.

Thats really my only complaint about FB's new features, with every respect of the difficulty of making consistent syntax.  The new features are just difficult for beginners.

I'm in the ballpark of just using a big chunk of 's.  But I can see some kid staring at a bunch of #IFDEF 0 and being dumbfounded.
Logged
keeling
Forum Regular
**
Posts: 149



WWW
« Reply #13 on: May 04, 2005, 08:35:43 PM »

I know this is blasphemy but… what’s wrong with adding a few types of comments including (and here is where the stakes will start to burn) /* and */.

I am a HUGE fan of BASIC. IMHO it is the best language for what I do. I can code in C, C++, ForTran, Pascal, JAVA, IDL, etc., etc., etc. but I only use those if I have too. I LOVE BASIC!

Now having said that, I like the // and /* */ form of comments. No I’m not one who would wish to turn FB into C, I just like that style.

Why not have several comment commands? We already have two, why not 3, or 4, or 8? Or perhaps the IDE creators could add a feature that allows you to use whatever you want and then change it to a collection of apostrophes.

If you are going to add keywords, may I suggest that we keep it in a BASIC like manner? The idea of keeping the same form as TYPE and ENUM is attractive. I.e.

Code:
COMMENT
     PRINT “You won’t see this”
END COMMENT


Seems to keep the feel of BASIC yet remains structured and ‘modern’.

<opinion>REM always sucked, so why bring it back into a new light?< /opinion>

Here’s my two cents… don’t spend it all in one place.
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #14 on: May 04, 2005, 08:54:31 PM »

Quote from: "SSC"
Multi line rem? just create a new rem for each line you need

Code:
'this is rem 1
'this is rem 2
'and so on

SSC,

Yours is the KISS approach, and I totally agree. Let's not clutter up the language just to put comments in the code.
*****
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!