Read Tab table in LUA

Source: Internet
Author: User

I really want to save some non-essential information in the tab table format to the client to reduce the communication with the server and reduce the pressure. So I wrote this one.

But because of this, it is necessary to detect the synchronization of these data every time you log in, which slows down the landing speed and is not used.

I think that after the server pressure increases later, you can use this.

1 --2 --Created by IntelliJ.3 --User:elan4 --date:15-7-15 pm 12:145 --To change this template use File | Settings | File Templates.6 --7 LocalTabreader = Class ("Tabreader")8 9 functionTabreader:ctor ()Ten End One  A functionTabreader:Load(filename) -Self.fn =filename -  the     LocalFile =Io.open(Self.fn,"RB") -     if  notFile Then -         Print("File not exist", Self.fn) -         return false +     End -  +     Localstr =File:read("*all") A     Io.close(file) at  -     returnself:parse (str) - End -  - functiontabreader:parse (str) -     LocalContent = {} in     LocalList = String.Split (str,"\ r \ n") -  to     if#list <=1  Then +         returncontent -     End the  *     Table.remove(List,1)--The first line is the description of each field $ Panax Notoginseng      fori =1, #list Do -         Localline =String.ltrim (List[i]) the         if string.sub(Line,1,1) ~="#"  Then  --#开头的行为注释行 +             Localrows = String.Split (line,"\ t") AContent[content +1] =rows the         End +     End -  $     returncontent $ End -  - returnTabreader

Read Tab table in LUA

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.