Jump to content




Why my tables printing weird?


  • You cannot reply to this topic
4 replies to this topic

#1 LuaEclipser

  • Banned
  • 220 posts
  • LocationCleveland, Ohio

Posted 03 April 2013 - 01:47 PM

this is my code - http://pastebin.com/sFrM5je4

it is printing all weird

|
how? this V
Spoiler

can someone tell me WHY this is happening and how to fix it? (maybe a fixed code?) thanks!!




-LuaEclipser

#2 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 03 April 2013 - 03:26 PM

because the string contains backslashes (the escape operator), replace all instances of "\" with "\\" in the strings

#3 LuaEclipser

  • Banned
  • 220 posts
  • LocationCleveland, Ohio

Posted 03 April 2013 - 03:33 PM

View PostPixelToast, on 03 April 2013 - 03:26 PM, said:

because the string contains backslashes (the escape operator), replace all instances of "\" with "\\" in the strings
D: that ruins the ASCII art D: any other way?

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 03 April 2013 - 06:40 PM

No, the point is that it un-ruins the ASCII art. It looks funny in the code, but prints correctly. You could also put each line in block quotes instead.

#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 03 April 2013 - 06:51 PM

and by block quotes he means

local someVar = [[multi-line
string where
you can use \ freely]]

a example (all of the below will print a diamond to the screen)
Spoiler

Edited by theoriginalbit, 03 April 2013 - 06:52 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users