JRowe Posted November 11, 2008 Share Posted November 11, 2008 Can I create an array, then convert it's binary form into a string, and then back into an array? I know I can get the data from each element, but I was wondering if there was a way to access and store the structure directly. Dim $test[10] $test[0] = "Blah Blah" $test[1] = 123 $test[2] = "Will this work?" $test[3] = 444 $test[4] = "xyzzy" $test[5] = $test[4] $test[6] = "xyzzy... third time's a charm, amirite?" $test[7] = 90210 $test[8] = "Jenny... what's your number?" $test[9] = 8675309 $binary = Binary($test) msgbox(0, "Display the binary data representing the whole array",$binary) That works on elements when $binary = Binary($test) is changed to $test[1], etc. It doesn't work for the whole array. Anyone know if this is doable? [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
ludocus Posted November 11, 2008 Share Posted November 11, 2008 this would to the job: #include <Array.au3> Dim $test[10] $test[0] = "Blah Blah" $test[1] = 123 $test[2] = "Will this work?" $test[3] = 444 $test[4] = "xyzzy" $test[5] = $test[4] $test[6] = "xyzzy... third time's a charm, amirite?" $test[7] = 90210 $test[8] = "Jenny... what's your number?" $test[9] = 8675309 $binary = Binary(_ArrayToString($test)) msgbox(0, "Display the binary data representing the whole array",$binary) Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Author Share Posted November 11, 2008 Thanks [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 11, 2008 Share Posted November 11, 2008 Hopefully that's not Jenny's real number, she might not be to happy. Giggity Link to comment Share on other sites More sharing options...
ludocus Posted November 11, 2008 Share Posted November 11, 2008 Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Author Share Posted November 11, 2008 That's the world's most famous phone number [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Author Share Posted November 11, 2008 Not quite what I was aiming for, by the way. What I want to do is literally rip the binary of the array itself out of memory, not just the delimited elements in a string. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
monoceres Posted November 11, 2008 Share Posted November 11, 2008 Not quite what I was aiming for, by the way. What I want to do is literally rip the binary of the array itself out of memory, not just the delimited elements in a string.I'm not sure how you mean but maybe you could save your data in a struct? That way you can have complete access to the "raw" data through a pointer. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Author Share Posted November 11, 2008 My idea was to save the array as a file, without having to parse it. Also, knowing the format of an autoit array in memory opens up possibilities with the plugin sdk. I'd fill my array, write it to disk as something like a myArray.array file, then open it later , something like $myNewArray = fileOpen("myArray.array")to retrieve the data written with the first script, in native AutoIt array format. I tried a while back never got anywhere, but I never asked either, so I thought I'd ask this time [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
monoceres Posted November 11, 2008 Share Posted November 11, 2008 My idea was to save the array as a file, without having to parse it. Also, knowing the format of an autoit array in memory opens up possibilities with the plugin sdk. I'd fill my array, write it to disk as something like a myArray.array file, then open it later , something like $myNewArray = fileOpen("myArray.array")to retrieve the data written with the first script, in native AutoIt array format. I tried a while back never got anywhere, but I never asked either, so I thought I'd ask this time In my media player project (which is abandoned btw) I stored my playlist (along with the ID3 tags of the songs) in structs, then later when I wanted to save/load my playlists I just used _WinAPI_ReadFile()/WriteFile(). I managed to save/load 7000+ songs ID3 data < 1 second. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Valuater Posted November 11, 2008 Share Posted November 11, 2008 _FileReadToArray() and _FileWriteFromArray ??? 8) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now