Jump to content




[Question]How do you have a long code in an a string


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

#1 whatsfast

  • New Members
  • 35 posts

Posted 26 November 2012 - 05:29 AM

I want to put a program in a string. How would I do that. The programs 40 lines long.

#2 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 26 November 2012 - 06:43 AM

You can use the fs API to read files.

local programname = 'your_program_name'
local content

local file = fs.open(programname)
if file then
  content = fs.readAll()
  file.close()
end
In this example, the program is stored in the variable content.

#3 whatsfast

  • New Members
  • 35 posts

Posted 26 November 2012 - 07:26 AM

The program will be a client api. Can the other person on a server access my files. Anyway is it possible to put multiple lines in a string. I would like to have a program server maybe.

#4 whatsfast

  • New Members
  • 35 posts

Posted 26 November 2012 - 07:30 AM

I figured out the multi line integar but my other question still remains. Can other people save or edit files on my computer or only on theirs?

#5 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 26 November 2012 - 07:34 AM

View Postwhatsfast, on 26 November 2012 - 07:30 AM, said:

I figured out the multi line integar but my other question still remains. Can other people save or edit files on my computer or only on theirs?
They can easily save and edit files on your computer, but only while ON your computer. They can't do it from their own computer; you would need to set up sort of an FTP server to do that. There are plenty of FTP programs on the forums, if you search around a bit.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users