Search the Community
Showing results for tags 'store'.
-
Needed a way to store global temporary & permanent information and came up with this. This is inspired by NodeJS's store and store2 packages, as well as W3 specs' localStorage and sessionStorage, offering multiple ways of usage. This is not related to any browser's storage, nor will allow you to access or modify browsers storage - although this is possible and not a hard task, this is not what this UDF is intended to do. This UDF offers functions for temporary storage (that gets cleaned up once the application is shutdown) that is kept on memory using ScriptingDictionary, as well as for permanent storage, that is saved on the harddisk as an encrypted file. sessionStorage (temporary storage) It's useful to keep application state and temporary settings accessible by any part of your script (although it could also be done with a global variable, I still prefer this method). You have multiple ways, at your choice, to: ; add or modify a key sessionStorage("foo", "bar") store("foo", "bar") sessionStorage_set("foo", "bar") sessionStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = sessionStorage("foo") $read = store("foo") $read = sessionStorage_get("foo") $read = sessionStorage_getItem("foo") ; delete a key sessionStorage_remove("foo") ; delete all keys sessionStorage_clear() sessionStorage_clearAll() localStorage (permanent storage) It's useful to store user-defined settings. ; initialize ; this is optional, but allows you to control ; how things are going to be saved localStorage_startup([file where you want the settings to be saved], [crypt password]) ; by default, if not supplied, if supplied the "Default" keyword (or if you dont initialize), ; the file will be a random-named file (based on @ScriptFullPath) at user's %APPDATA% ; and the password will also be based on @ScriptFullPath ; you can set only the crypt password if you want: ; localStorage_startup(Default, "mypassword") ; the usage is the same as sessionStorage ; add or modify a key localStorage("foo", "bar") store2("foo", "bar") ; notice the '2' localStorage_set("foo", "bar") localStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = localStorage("foo") $read = store2("foo") $read = localStorage_get("foo") $read = localStorage_getItem("foo") ; delete a key localStorage_remove("foo") ; delete all keys localStorage_clear() localStorage_clearAll() Download
-
Hello Is there anyway to store word documents in Autoit GUI? For example I have a instruction sheet that I want to bundle up with the exe. So a user simply clicks the icon and the stored document will launch (Something like how you can add objects like excel sheets in word documents ) (I Know we can launch word files from script directory)
-
Hello all. First a brief background. My programming knowledge falls probably somewhere in the range of general knowledge to intermediate. I have currently written a form filler program in Auto IT that I have pre-populated with the data (email address, password, name, etc.) which is used to fill form. Each category of the form filler displays the data in a combo box, which is meant to allow users to input multiple instances for each category in the event (like all of us I'm sure) that the user has more than one email account, password, etc. However, my goal is for the program, either when it is launched for the first time or when the user selects a particular menu item, is to allow the user to edit/configure the data which populates these categories in the form filler. What element/object/function can I use to accomplish this? I did some research prior to this, and I found that using ini files or a local database might allow me to accomplish my goal, but I wanted to get some opinions from veteran programmers as well. Also, (this is kind of a secondary request) does anyone know where I can find some good reference material if I wanted to learn more about development in a Windows environment and the tools introduce more functionality into the development environment.
-
Hello everyone, I was trying to store this string into my array: "Hamsters | Cute" But after I store it, I used _ArrayDIsplay and it showed "Hamster" being on one row and "Cute" being on the row after it. So it looks like the "|" symbol acts as a row seperator in an array. My question is: Is there a way for my array to display "Hamsters | Cute" in 1 row ? Thanks, Brian
-
For example my GUICtrlCreateEdit() contains: Line 1 Line 2 Line 3 When I IniWrite() the content of it, the value will be look like this: [SectionName] Key=Line 1 Line 2 Line 3 But when I IniRead() that key like this: GUICtrlCreateEdit(IniRead(@ScriptDir & "/data.ini", "SectionName", "Key", ""), 1, 1, 200, 100) The value of the GUI edit field is only "Line 1".. How can I INI write and read a text with line breaks in a GUICtrlCreateEdit() ?