This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:serialize [2016/09/08 12:38] admin |
en:serialize [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
==== Format ==== | ==== Format ==== | ||
- | **serialize** ( [[arrays|array]] )\\ | + | **serialize** ( [[arrays|variable[]]] )\\ |
**serialize** ( [[Lists|{ x1, y1, x2, y2, x3, y3 ... }]] ) | **serialize** ( [[Lists|{ x1, y1, x2, y2, x3, y3 ... }]] ) | ||
Line 12: | Line 12: | ||
Often developers will create a serialized string so that they may save the values in an array into a data file or a database table. | Often developers will create a serialized string so that they may save the values in an array into a data file or a database table. | ||
+ | |||
+ | === Format of the Serialized Array === | ||
+ | |||
+ | The string representing the array' | ||
+ | |||
+ | The array {1, | ||
==== Example ==== | ==== Example ==== | ||
< | < | ||
+ | dim a(3,4) | ||
+ | a[0,0] = 0 | ||
+ | a[1,1] = 1 | ||
+ | a[2,2] = 2 | ||
+ | a[0,1] = ' | ||
+ | a[1,2] = 1.234 | ||
+ | stuff = serialize(a[]) | ||
+ | print stuff | ||
+ | |||
+ | dim c = unserialize(stuff) | ||
+ | # the array c is an exact copy of the array a | ||
</ | </ | ||
will display | will display | ||
< | < | ||
+ | 3: | ||
</ | </ | ||
Line 25: | Line 42: | ||
==== History ==== | ==== History ==== | ||
- | |1.99.99.65|New to Version| | + | |1.99.99.66|New to Version| |
+ | |1.99.99.72|added required [] to passing variable array| |