Jump to content




[Lua]IF statement in loadstring?


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

#1 Timtower

  • New Members
  • 2 posts

Posted 08 February 2013 - 05:50 AM

Title:[Lua]IF statement in loadstring?

Hi,
I am trying to create an php like internet for computercraft but I am stuck on something:
my entire program is dependent on the loadstring thingie.
but my problem is that IF statements won't work on the normal way,
any ideas?
here is the link to my code ;)
everything is in Dutch, but I hope that that won't be a problem
http://pastebin.com/F0Qs3cEt

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 08 February 2013 - 07:20 AM

They do work the normal way. You're missing an end on that if string near the beginning of your program though, so that string won't load. Also, you may wish to use block quotes. Anything in them will not require escaping. [[So you can "write" like this 'and' not need

to escape your text()]]

#3 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 08 February 2013 - 07:29 AM

Good idea so far. But the difference between this and PHP is that this sends the "program", the entire script to the client, and that's pretty risky. In PHP, you cannot just read the PHP code, you get the "preprocessed" HTML page instead. (Y'know: Personal Homepage: Hypertext Preprocessor...)

#4 Timtower

  • New Members
  • 2 posts

Posted 08 February 2013 - 07:53 AM

View PostLyqyd, on 08 February 2013 - 07:20 AM, said:

They do work the normal way. You're missing an end on that if string near the beginning of your program though, so that string won't load. Also, you may wish to use block quotes. Anything in them will not require escaping. [[So you can "write" like this 'and' not need to escape your text()]]
Thank you, the block quotes work like a charm

View PostLBPHacker, on 08 February 2013 - 07:29 AM, said:

Good idea so far. But the difference between this and PHP is that this sends the "program", the entire script to the client, and that's pretty risky. In PHP, you cannot just read the PHP code, you get the "preprocessed" HTML page instead. (Y'know: Personal Homepage: Hypertext Preprocessor...)
And I dont care that it is risky ;) I don't want to change the code on 10 computers to show the page on the right way ;)





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users