Jump to content

FRED: Format Recursive Encapsulation Data


Luigi
 Share

Recommended Posts

This is script is a better version from 'write array to ini and read ini to array'.

You can save (almost) any kind of data (integer, float, string, array* and Scripting.Dicionary) in string.

You can save an array like this:

Local $aTest[2] = ['Violão', 'Argüição']

In this string:

32a2[8sViol~E3o,14sArg~FCi~E7~E3o]

This string you can save in ini file, data base.

When you run you script again, load this string and use decode fuction, it will rebuil a array[2] with all values.

Characteristcs:

  • is recursive
  • work with any kind of array*
  • work with Scripting.Dicionary
  • you can put a Scripting.Dicionary into array
  • you can put a array into array into array into array...
  • have self character encoding/decoding

 

Is very similar to JSON. Some concepts is from JSON, but, is disegned for AutoIt.

Not is JSON! It is FRED!  :geek:

Need refactor errors message.

Restrictions

  • *work with array[n1] to array[n1][n2][n3][n4][n5][n6][n7][n8][n9][n10]

 

Refactor (@TODO)

  • errors message

 

Fred_Code.au3   25.14KB   37 downloads

https://github.com/chechelaky/AutoIt/tree/master/FRED

 

Edited by Luigi

Visit my repository

Link to comment
Share on other sites

  • 2 years later...

Very very useful. Thank you

Can we put an array or another "Scripting.Dictionary" in a "Scripting.Dictionary"?

Could you integrate the new type "MAP" of the beta 3.3.16 in addition to Stripting dictionary.

Thank you

Edited by MimiOne

I'm not always in my opinion...

Link to comment
Share on other sites

  • 3 weeks later...
On 28/11/2016 at 1:57 PM, MimiOne said:

Can we put an array or another "Scripting.Dictionary" in a "Scripting.Dictionary"?

Yes, it's is possible.

I always use SD (Scripting.Dictionary) to work similar JSON encode.

See the JSMN, I made some "things".

Write SD, encode JSON and send...

Receive JSON, decode to SD to work in AutoIt.

On 28/11/2016 at 1:57 PM, MimiOne said:

Could you integrate the new type "MAP"

I don't know this. Hum... Cool, like indexed array.

Edited by Luigi

Visit my repository

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...