Jump to content

storing a lot non-subsequent and uneven digit of numbers somewhere


FMS
 Share

Recommended Posts

Hello,

I've a question about "storing a lot non-subsequent and uneven digit of numbers somewhere" and find/retrieve it when needed.
I use a lot of *.ini files at the moment for other things in mine script.
but this list of numbers is to large and unmanagebale to store them inside an *.ini.

In the script I've 3 comboboxes.
If the first 2 comboboxes are selected the third combobox will be filled in whit a selection of thoose numbers i speak of before.

I can't put them in an array or something inside the script because the numbers change often and needs to be changed outside the script.

Does somebody know a good way to do this?


 

as finishing touch god created the dutch

Link to comment
Share on other sites

You can store them in a file with a delimiter. When you need to retrieve them then use string split to split it by the delimiter. Giving you an array with each element.

#include <Array.au3>
#include <File.au3>

Local $aData[255]
Local $sFileData = ""
For $i = 0 to 254
    $aData[$i] = Round(Random(1, 65536), 3)
Next
$sFileData = _ArrayToString($aData, "|")
_ArrayDisplay($aData, "$aData Array")

FileWrite(@TempDir & "\Numbers.txt", $sFileData)

ShellExecute(@TempDir & "\Numbers.txt")
Sleep(1000)

$aData = 0

ConsoleWrite("A data has been destroyed" & @CRLF)
ConsoleWrite("Contents of our 'Numbers.txt' file: " & FileRead(@TempDir & "\Numbers.txt") & @CRLF)

Local $aLoadedData = StringSplit(FileRead(@TempDir & "\Numbers.txt"), "|")
_ArrayDisplay($aLoadedData, "$aLoadedData Array")
FileDelete(@TempDir & "$sFileData")

 

Link to comment
Share on other sites

Couple of thoughts...

At the end, you stringsplit the file, then arraydisplay.  If that display is complete it would probably fit in an ini

Not that I would use one, but also if you know the element in the array you would want to retrieve you could probably filereadline.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...