Sign in to follow this  
Followers 0
sergeyWolf

Best way for storage data (arrays) in file.

17 posts in this topic

Currently i store in .ini files but they can't save too deep arays. What i'm talk about - for example we got array $example[10][10][10][10]. Ini files have just "section"=>"key"=>"value", but we got deeper array. Is there another way to store such arrays? (i don't want write special fuctions and store it in txt files)


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

for example we got array $example[10][10][10][10].

When do you use such array???

Did you know about dimension in arrays a 2D arrays is more than enough for mostly of cases. Also you can set an array within an array if you really need.

But a 4D array it seems an exaggeration.

As @JhonOne says a XML file maybe is more useful than a INI.

If you post an example of what you are doing maybe we can advise some other propper way for storing your data.

Edited by monoscout999

Share this post


Link to post
Share on other sites

"$example[10][10][10][10]"

Is that even valid?

If so I imagine you could use xml file.

But I'm also sure you could still use ini files with a bit of creative coding and vulcan logic.

i show just example (autoit didn't can such arrays? О.о i didn't knew), i hope every1 understood what i meant

and yes, thnx xml would be best way, but in help there is not info about xml at all :)

ps: i'm not know in autoit as you can see, so sorry by such examples


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

There is an XML UDF in the example Scripts Forum section. look for it.

Share this post


Link to post
Share on other sites

i show just example (autoit didn't can such arrays? О.о i didn't knew), i hope every1 understood what i meant

and yes, thnx xml would be best way, but in help there is not info about xml at all :)

ps: i'm not know in autoit as you can see, so sorry by such examples

yep, founded, thnx


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

I think relational databases in SQLite would fit the bill and make it much easier/simpler to retrieve the data :)

Share this post


Link to post
Share on other sites

I think relational databases in SQLite would fit the bill and make it much easier/simpler to retrieve the data :)

xml easier, and i already saw it can store as i need

SQLite (as i think) for huge projects\programs, not my situation, i need simply store huge arrays and read them

anyway thnx, it's a another way


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

Glad you found a solution. ;)

By the way what is the actual number of dimensions of your array? :)

Share this post


Link to post
Share on other sites

in php i used about 4-7 in deep something like this (just in general to show where i use it)

$user["user_name1"]=>"id1"=>"itemName1"=>"detail1"=>"construction_part1"=>"mineral1"=>"price1"

$user["user_name1"]=>"id1"=>"itemName1"=>"detail2"=>"construction_part1"=>"mineral2"=>"price2"

and so go on...

each part of array can be different, some empty \ some up to 20

it's an array of manufacturing items (for game calculation)

unfortunately now this arrays would be replaced by xml

ps: example taken from php, i will not rewrite properly for autoit syntax


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

ps: example taken from php, i will not rewrite properly for autoit syntax

solution founded, can be closed :)

WBR Sergey


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

So it appears to be a 2d array then? A single table with 7 or so columns should do the trick? XML seems to be over complicating things then, and I think SQLite will offer more flexibility when traversing/retrieving the data anyway, we can help you code it if you're intimidated by all the SQL mumbo jumbo.

I suggest you edit out what you have between those braces in the above post.

Pfft recently I revised my panic bells' sensitivity. This looks abiding so far, to me at least.

EDIT: Two terrifying typos trickled through the text. :)

Edited by smartee

Share this post


Link to post
Share on other sites

in php i used about 4-7 in deep something like this (just in general to show where i use it)

$user["user_name1"]=>"id1"=>"itemName1"=>"detail1"=>"construction_part1"=>"mineral1"=>"price1"

$user["user_name1"]=>"id1"=>"itemName1"=>"detail2"=>"construction_part1"=>"mineral2"=>"price2"

and so go on...

each part of array can be different, some empty \ some up to 20

it's an array of manufacturing items (for game calculation)

unfortunately now this arrays would be replaced by xml

ps: example taken from php, i will not rewrite properly for autoit syntax

this is a 2d array or you can store all in a 2d array, maybe some items in the array can point you to other points of the same array.

Share this post


Link to post
Share on other sites

i'll post special for you both example from php, there are NOT 2d\3d arrays you will a little bit later


- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

<?php

for ($i = 0; $i < get_user_counter(); $i++) {
    $user["name"][$i] = get_item();
}

function get_user_counter() {
    return sql_query(); # return INT
}

function get_item() {
    $_data = sql_query(); # return array

    foreach ($_data as $k => $v) {
        if ($k == "blueprint") {
            $_data[]["bpo_list"] = get_details_list();
        }
    }
    return $_data;
}

function get_details_list() {
    $_details = sql_query(); #return array
    foreach ($_details as $k => $v) {
        if ($k == "blueprint") {
            $_details[]["bpo_list"] = get_parts_list();
        }
    }
    return $_details;
}

function get_parts_list() {
    $_parts = sql_query(); #return array
    foreach ($_parts as $k => $v) {
        if ($k == "blueprint") {
            $_parts[]["bpo_list"] = get_mineral_list();
        }
    }
    return $_parts;
}

function get_mineral_list() {
    $_mineral = sql_query();
    foreach ($_mineral as $k => $v) {
        $_price = get_price($k);
        if ($_price) {
            $_mimeral[]["mineral_price"] = $_price;
        }
    }
    return $_mineral;
}
?>

and now imagine 498573297 people manufacturing different cars or planes

ps: i didn't post sql_query () and results if you can't understand this example - not my problems, that's all i left sleep my time is 04:56, **cking examples

Edited by sergeyWolf

- I want program that crack all other programs...- Let's split up, i'll search this program and you'll find crack for it. ^_^'

Share this post


Link to post
Share on other sites

if you can't understand this example - not my problems

yes nice to meet you too... :) i can`t understand the example

Share this post


Link to post
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
Sign in to follow this  
Followers 0