Re: ArrayEncode/Decode broken??

2022-03-19 Thread J. Landman Gay via use-livecode

On 3/19/22 3:27 PM, Bob Sneidar via use-livecode wrote:

I’m so embarrassed.


I was too but I caught myself before I hit the Send button. We get so used to LC reading our 
minds we're surprised when it doesn't.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: ArrayEncode/Decode broken??

2022-03-19 Thread Bob Sneidar via use-livecode
I’m so embarrassed. On my way to the beach this morning it hit me like a ton of 
bricks. DOH! 

Sent from my iPhone

> On Mar 18, 2022, at 17:11, J. Landman Gay via use-livecode 
>  wrote:
> 
> I made the same mistake a while ago, until I remembered that the encoded 
> array is binary. You have to write and read it to/from a binary file. If you 
> just use "open file" you get text only.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>> On March 18, 2022 6:40:40 PM Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> 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
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: ArrayEncode/Decode broken??

2022-03-18 Thread J. Landman Gay via use-livecode
I made the same mistake a while ago, until I remembered that the encoded 
array is binary. You have to write and read it to/from a binary file. If 
you just use "open file" you get text only.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 18, 2022 6:40:40 PM Bob Sneidar via use-livecode 
 wrote:



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


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


ArrayEncode/Decode broken??

2022-03-18 Thread Bob Sneidar via use-livecode
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


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode