I have a text file(XXX.txt), and it`s content : {"A":{},"B":{},"C":{"a":["a1","a2","a3","a4"],"b":[],"c":[],"d":[],"e":[]}}
this is a string,but i need to convert it into a array.
when I use "fileread" , it always store as value, not an object.
question about array Topic is solved
Re: question about array Topic is solved
Code: Select all
#Include JSON.ahk ; https://github.com/cocobelgica/AutoHotkey-JSON
testText = {"A":{},"B":{},"C":{"a":["a1","a2","a3","a4"],"b":[],"c":[],"d":[],"e":[]}}
value := JSON.Load(testText)
MsgBox % value.c.a.1
Re: question about array
You can't save/read objects like that directly, so you would either have to write your own parser (converting the FileRead data to an object).
Or use other formats such as XML, CSV, JSON or "binary" - see the XA (xml), ObjCSV, AutoHotkey-JSON or ObjDump/ObjLoad (binary), each has its pros and cons.
Or use other formats such as XML, CSV, JSON or "binary" - see the XA (xml), ObjCSV, AutoHotkey-JSON or ObjDump/ObjLoad (binary), each has its pros and cons.
Re: question about array
thank for your helping!
it works perfect!
it works perfect!
Who is online
Users browsing this forum: Bing [Bot], Spawnova and 239 guests