View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:21 am



Reply to topic  [ 6 posts ] 
 Comment blocks do not work. 
Author Message

Joined: Mon Dec 20, 2010 6:52 pm
Posts: 5
Reply with quote
Post Comment blocks do not work.
I tried to comment out a section of my code with /* */ (which works in fine gmod's implementation of lua), but CC told me there was an "unexpected character near /"

Anyone else get this error? I hate having to comment out line by line.


Sun Dec 26, 2010 5:08 am
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post Re: Comment blocks do not work.
Since comments in .inis are //, I guess Data made them -- in Lua.

I believe the way to do block comments is --[[ and ]]-- .

This too:
http://www.ozone3d.net/blogs/demoniak3d/?p=36


Sun Dec 26, 2010 5:30 am
Profile WWW
User avatar

Joined: Wed Feb 10, 2010 4:06 am
Posts: 1294
Location: Comox, BC, Canada
Reply with quote
Post Re: Comment blocks do not work.
In .ini you block comment like this

/*
BLEHBLEHBLEH
BLEHBLEHBLEH
*/


EDIT: OH ♥♥♥♥ I'M DUMB. Serves me right for not reading your post.


Sun Dec 26, 2010 5:53 am
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Comment blocks do not work.
It works for me as
Code:
--[[
Comment here
More comments
Blah Blah
--]]


Sun Dec 26, 2010 5:54 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Comment blocks do not work.
Standard lua block comments start with --[[ and are terminated by ]]. I think --]] is just used for syntactic cleanliness.


Sun Dec 26, 2010 7:06 am
Profile
User avatar

Joined: Mon Jun 15, 2009 4:02 pm
Posts: 905
Reply with quote
Post Re: Comment blocks do not work.
Garry just added C style commenting because he preferred it to regular commenting in Lua.


Sun Dec 26, 2010 9:11 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.044s | 14 Queries | GZIP : Off ]