Problem with reading Preferences file

Klaus on-rev klaus at major.on-rev.com
Sun Nov 13 14:08:31 EST 2011


Hi Charles,

Am 13.11.2011 um 19:57 schrieb Charles Szasz:

> Klaus,
> 
> I left out this bit code: (put arrayDecode(tPrefs)into tPrefs)

AHA! :-D

> So, my code looks like this:
> IF the platform is "MacOS" then 
>      if there is a file (specialFolderPath(26) & "/" & "mileage_prefs") then

OK, there is no specialfolderpath (26) on a Mac but a specialfolderpath("preferences")!
Otherwise this should work!

>         put url ("binfile:" & specialFolderPath("preferences") & "/" & "mileage_prefs") into tPref

Here you use the correct specialfolderpath, but now its too late ;-)

>         put arrayDecode(tPrefs)into tPrefs
>                  put tPrefs["name"] into field "name" of card id 1002 of stack "prefs"
>         put tPrefs["name"] into field "name" of card "one" of stack "mileage report"
>  end if
> end if
> 
> IF the platform is "win32" then
>      if there is a file (specialFolderPath(26) & "/" & "mileage_prefs") then 
>         put url ("binfile:" & specialFolderPath(26) & "/" & "mileage_prefs") into tPrefs
>         put arrayDecode(tPrefs) into tPrefs
>         -- now fill in all my data...
>         put tPrefs["name"] into field "name" of card id 1002 of stack "prefs"
>      end if
> end if

See abvoe, this shouold work in general.
How and what do you save?

> Charles Szasz
> cszasz at mac.com

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com





More information about the use-livecode mailing list