PtokaX forum

Development Section => Your Developing Problems => Topic started by: kepp on 10 January, 2004, 02:15:12

Title: arg = [[Any other arguments in here?]]
Post by: kepp on 10 January, 2004, 02:15:12
Is it possible to do add arguments inside these blocks?

any = [[ ]]

or is it just for plain text?
Title:
Post by: pHaTTy on 10 January, 2004, 02:40:22
i dont understand what you mean, can you explain?
Title:
Post by: kepp on 10 January, 2004, 02:44:42
ok.. hmm

BotName = "Cowboy"

disp = [[Hello "..BotName.." ]]
Title:
Post by: plop on 10 January, 2004, 02:49:19
QuoteOriginally posted by kepp
ok.. hmm

BotName = "Cowboy"

disp = [[Hello "..BotName.." ]]
disp = ("hello"..BotName.." rest of the text "..anotherargument.." some more text")

plop
Title:
Post by: kepp on 10 January, 2004, 02:57:37
I know that :)

But i saw something like this in the manual

text_to_display = [[

hello, i saw this examle in the manual
more text
and some more
]]
Title:
Post by: NotRabidWombat on 10 January, 2004, 05:49:12
read more of the manual ;-)
[[ ]] is an extended string deliminator so you can include endlines

[[
Hello
this is
a test
]];

is equivalent to

"Hello\nthis is\na test\n";

you can not include arguments in there like php. You can include arguments in [ ] which is used for indexing tables.

-NotRabidWombat
Title:
Post by: plop on 10 January, 2004, 12:12:03
yep, they only take strings.
for example
print("lua board")
would give an error on the " in the url.
you would either need 2 use format 2 make all the escapes or do it yourself by hand.
this is much easyer.
print([[lua board]])
if you search your book for [[ you'll see that it's mostly used on website's or 2 show program pieces.

plop
Title:
Post by: kepp on 11 January, 2004, 10:47:11
Ok, because i was gonna use it for JavaScript and it would be great if i could take and put LUA in it :)