ArrayEncode/Decode broken??

Bob Sneidar bobsneidar at iotecdigital.com
Fri Mar 18 19:38:29 EDT 2022


Hi all. 

I'm running 9.6.7 rc2. I have this code in a closeStackRequest handler:

   put the settings of me into tSettingsA
   put field "fldEAFilePath" into tSettingsA ["eafilepath"]
   put field "fldInvFilePath" into tSettingsA ["invfilepath"]
   put field "fldOutFilePath" into tSettingsA ["Outfilepath"]
   put the dgText [true] of group "dgVariance" into tSettingsA ["gridtext"]
   put arrayEncode(tSettingsA) into tSettingsText
   put the filename of this stack into tSettingsPath
   set the itemDelimiter to "/"
   put "settings.prefs" into item -1 of tSettingsPath
   open file tSettingsPath for write
   write tSettingsText to file tSettingsPath
   close file tSettingsPath

Then in the openStack handler I have this:

   put the filename of this stack into tSettingsPath
   set the itemDelimiter to "/"
   put "settings.prefs" into item -1 of tSettingsPath
   open file tSettingsPath for read
   read from file tSettingsPath until eof
   put it after tSettingsText
   close file tSettingsPath
   put arrayDecode(tSettingsText) into tSettingsA
   set the settings of me to tSettingsA

Instead of an array, I get the text "gr" which is the first 2 characters of the key "grid text" in the array. That can't be right! 

Bob S




More information about the use-livecode mailing list