Jump to content




[API]Consistant Variables

api lua computer

9 replies to this topic

#1 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 27 March 2012 - 12:38 PM

Consistant Variables
This is a new API, by me. It allows you to create variables, that can be used even after the program is exited, or the computer is rebooted. It saves the variables to the disk, and loads them when calling the variable.



NEWS!!!: Now supports tables! though not tableception :o/>
To create a table variable, use this code(With your own table ofc:D):
Spoiler

Functions
Spoiler


Examples
Spoiler



Code
Spoiler

Please leave some feedback, so I know what to improve. Enjoy!

#2 kamnxt

  • New Members
  • 80 posts

Posted 27 March 2012 - 02:28 PM

Nice API, but shouldn't it be in the "API's and Utilities" section?

#3 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 27 March 2012 - 03:15 PM

View Postkamnxt, on 27 March 2012 - 02:28 PM, said:

Nice API, but shouldn't it be in the "API's and Utilities" section?
Thanks!
It is in the "API's and Utilities" section, but not many people go there :o/>

#4 kamnxt

  • New Members
  • 80 posts

Posted 27 March 2012 - 04:20 PM

Maybe you could use the type(x) function so it would automatically set the type?
Like this:
x = "A variable."
var.create("MyVar", type(x)) --creates a string
var.setValue("MyVar",x)
y = 5
var.create("ANumber",type(y)) --creates a number
var.setValue("ANumber",y)
Btw, you could also change the directory from "/vars" to "/.vars" (hide it).

#5 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 27 March 2012 - 04:24 PM

And that saves the var even if the PC is shutdown

#6 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 29 March 2012 - 08:15 AM

View PostWolvan, on 27 March 2012 - 04:24 PM, said:

And that saves the var even if the PC is shutdown
Yes

#7 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 29 March 2012 - 12:54 PM

View Postmad, on 29 March 2012 - 08:15 AM, said:

View PostWolvan, on 27 March 2012 - 04:24 PM, said:

And that saves the var even if the PC is shutdown
Yes
Thank you! That's epic

#8 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 29 March 2012 - 05:07 PM

View PostWolvan, on 29 March 2012 - 12:54 PM, said:

View Postmad, on 29 March 2012 - 08:15 AM, said:

View PostWolvan, on 27 March 2012 - 04:24 PM, said:

And that saves the var even if the PC is shutdown
Yes
Thank you! That's epic
Thanks! No problem

#9 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 29 March 2012 - 05:48 PM

Am I allowed to use this in some of my programs I write and which I write for others

#10 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 30 March 2012 - 06:47 AM

View PostWolvan, on 29 March 2012 - 05:48 PM, said:

Am I allowed to use this in some of my programs I write and which I write for others
Yes, but include the license please xD





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users