Re: Saving Changes in iOS - Solved

2018-01-31 Thread Roger Guay via use-livecode
Thanks to Ralph and Klaus, I’ve succeeded in building my first iOS app that 
saves user data. The following post form Klaus did it.


> Please read up the specialfolderpath() section in the dictionary.
> 
> 1. specialfolderpath("documents”) is the folder inside of the application 
> bundle where we have write permissions!
> It is already there, do NOT try to create it!
> 
> 2. Add your "main" stack via the "Copy files" to your app.
> 
> 3. Then do this when the app (launcher) starts (preopenstack or openstack)
> ...
> ## Stack in users docs folder, where we have write permissions, means where 
> we can SAVE that stack:
> put specialfolderpath("documents") & "/your mainstack here.livecode" into 
> tTargetStack
> 
> ## This is the stack you added via "Copy files":
> put specialfolderpath("resources") & "/your mainstack here.livecode" into 
> tSourceStack
> 
> ## check if the app had already been opened before:
> if there is NOT a file tTargetStack then
>  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
> end if
> 
> ## Now open that new stack in the users docs folder and save it later without 
> problems:
> go stack tTargetStack
> ...
> 
> And don't forget to add:
> ...
> start using this stack…

This should be a tutorial somewhere.

Thanks again guys. Especially for being patient with me!!

Roger

___
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: Saving Changes in iOS

2018-01-29 Thread Ralph DiMola via use-livecode
The folders already exists. You can of course create sub-folders. In iOS "the 
Documents folder" is automatically backed up but "the Temporary Folder" is not. 
Apple reviewers will get upset if you put too much into the documents folder. 
You will be required to either move files to the temporary folder or mark them 
as "No Backup". Using iphoneDoNotBackupFile.

Example:

Put URL("File:" engine folder&"MyDatabase.db") into url ("File:" 
documents folder&"MyDatabase.db")
put revOpenDatabase("sqlite", the documents folder&"MyDatabase.db"), , ,) 
into tDatabaseID

You would put MyDatabase.db in the copy file pane of the standalone settings.


Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Roger Guay via use-livecode
Sent: Monday, January 29, 2018 12:41 PM
To: How to use LiveCode
Cc: Roger Guay
Subject: Re: Saving Changes in iOS

Hi Klaus,

So are you saying that I create a folder called 
"specialfolderpath("documents”)”, add this folder to the “Copy Files” of the 
Standalone Application Settings, and put my MainStack into it?

Thanks,
Roger

> On Jan 29, 2018, at 9:21 AM, Klaus major-k via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> You already named it:
> the documents folder
> the temporary folder
> 
> Is equivalent to:
> specialfolderpath("documents")
> specialfolderpath("temporary")
> 
> 

___
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: Saving Changes in iOS

2018-01-29 Thread Klaus major-k via use-livecode


> Am 29.01.2018 um 18:57 schrieb Klaus major-k via use-livecode 
> :
> 
> Hi Roger,
> 
>> Am 29.01.2018 um 18:41 schrieb Roger Guay via use-livecode 
>> :
>> 
>> Hi Klaus,
>> 
>> So are you saying that I create a folder called 
>> "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the 
>> Standalone Application Settings, and put my MainStack into it?
> 
> no, I'm not saying this! :-)
> Please read up the specialfolderpath() section in the dictionary.
> 
> 1. specialfolderpath("documents”) is the folder inside of the application 
> bundle where we have write permissions!
> It is already there, do NOT try to create it!

Addition, this only applies to iOS and Android!

On desktop, the documents folder is on oyur hard disk, to see it on your 
machine, use the message box:
answer specialfolderpath("documents")

> 2. Add your "main" stack via the "Copy files" to your app.
> 
> 3. Then do this when the app (launcher) starts (preopenstack or openstack)
> ...
> ## Stack in users docs folder, where we have write permissions, means where 
> we can SAVE that stack:
> put specialfoderpath("documents") & "/your mainstack here.livecode" into 
> tTargetStack
> 
> ## This is the stack you added via "Copy files":
> put specialfoderpath("resources") & "/your mainstack here.livecode" into 
> tSourceStack
> 
> ## check if the app had already been opened before:
> if there is NOT a file tTargetStack then
>  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
> end if
> 
> ## Now open that new stack in the users docs folder and save it later without 
> problems:
> go stack tTargetStack
> ...
> 
> And don't forget to add:
> ...
> start using this stack
> ...
> to your LAUNCHER Stack before opening other stacks, so your separate "main" 
> stack can use 
> all of its scripts, libraries, externals etc.
--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
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: Saving Changes in iOS

2018-01-29 Thread Klaus major-k via use-livecode
Hi Roger,

> Am 29.01.2018 um 18:41 schrieb Roger Guay via use-livecode 
> :
> 
> Hi Klaus,
> 
> So are you saying that I create a folder called 
> "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the 
> Standalone Application Settings, and put my MainStack into it?

no, I'm not saying this! :-)
Please read up the specialfolderpath() section in the dictionary.

1. specialfolderpath("documents”) is the folder inside of the application 
bundle where we have write permissions!
It is already there, do NOT try to create it!

2. Add your "main" stack via the "Copy files" to your app.

3. Then do this when the app (launcher) starts (preopenstack or openstack)
...
## Stack in users docs folder, where we have write permissions, means where we 
can SAVE that stack:
put specialfoderpath("documents") & "/your mainstack here.livecode" into 
tTargetStack

## This is the stack you added via "Copy files":
put specialfoderpath("resources") & "/your mainstack here.livecode" into 
tSourceStack

## check if the app had already been opened before:
if there is NOT a file tTargetStack then
  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
end if

## Now open that new stack in the users docs folder and save it later without 
problems:
go stack tTargetStack
...

And don't forget to add:
...
start using this stack
...
to your LAUNCHER Stack before opening other stacks, so your separate "main" 
stack can use 
all of its scripts, libraries, externals etc.

> Thanks,
> Roger

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
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: Saving Changes in iOS

2018-01-29 Thread Roger Guay via use-livecode
Hi Klaus,

So are you saying that I create a folder called 
"specialfolderpath("documents”)”, add this folder to the “Copy Files” of the 
Standalone Application Settings, and put my MainStack into it?

Thanks,
Roger

> On Jan 29, 2018, at 9:21 AM, Klaus major-k via use-livecode 
>  wrote:
> 
> You already named it:
> the documents folder
> the temporary folder
> 
> Is equivalent to:
> specialfolderpath("documents")
> specialfolderpath("temporary")
> 
> 

___
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: Saving Changes in iOS

2018-01-29 Thread Klaus major-k via use-livecode
Hi Roger,

> Am 29.01.2018 um 17:17 schrieb Roger Guay via use-livecode 
> :
> 
> Sorry Klaus and Ralph, but I’m not getting it. How/where do I find the "the 
> documents folder" or "the temporary folder”?

You already named it:
the documents folder
the temporary folder

Is equivalent to:
specialfolderpath("documents")
specialfolderpath("temporary")

> (Preparing right hand for dope-slap)
> Thanks,
> Roger
> 
>> On Jan 29, 2018, at 8:30 AM, Ralph DiMola  wrote:
>> 
>> Roger,
>> On Android and iOS "the engine folder" is read only. Any files/stacks you 
>> want to save/modify must be moved to "the documents folder" or "the 
>> temporary folder" before they can be modified/saved.

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
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: Saving Changes in iOS

2018-01-29 Thread Roger Guay via use-livecode
Sorry Klaus and Ralph, but I’m not getting it. How/where do I find the "the 
documents folder" or "the temporary folder”?

(Preparing right hand for dope-slap)

Thanks,
Roger

> On Jan 29, 2018, at 8:30 AM, Ralph DiMola  wrote:
> 
> Roger,
> 
> On Android and iOS "the engine folder" is read only. Any files/stacks you 
> want to save/modify must be moved to "the documents folder" or "the temporary 
> folder" before they can be modified/saved.
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Roger Guay via use-livecode
> Sent: Monday, January 29, 2018 10:15 AM
> To: use-livecode@lists.runrev.com
> Cc: Roger Guay
> Subject: Saving Changes in iOS
> 
> I know I’m out to lunch again, but I notice that one cannot use the ol’ 
> Launcher+MainStack method in iOS to save user changes. What’s up with that? 
> How does one save user changes in iOS?
> 
> Thanks,
> 
> Roger
> ___
> 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: Saving Changes in iOS

2018-01-29 Thread Ralph DiMola via use-livecode
Roger,

On Android and iOS "the engine folder" is read only. Any files/stacks you want 
to save/modify must be moved to "the documents folder" or "the temporary 
folder" before they can be modified/saved.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Roger Guay via use-livecode
Sent: Monday, January 29, 2018 10:15 AM
To: use-livecode@lists.runrev.com
Cc: Roger Guay
Subject: Saving Changes in iOS

I know I’m out to lunch again, but I notice that one cannot use the ol’ 
Launcher+MainStack method in iOS to save user changes. What’s up with that? How 
does one save user changes in iOS?

Thanks,

Roger
___
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: Saving Changes in iOS

2018-01-29 Thread Klaus major-k via use-livecode
Hi Roger,

> Am 29.01.2018 um 16:14 schrieb Roger Guay via use-livecode 
> :
> 
> I know I’m out to lunch again, but I notice that one cannot use the ol’ 
> Launcher+MainStack method in iOS to save user changes. What’s up with that? 
> How does one save user changes in iOS?

copy your MAIN stack to the users documents folder on first launch 
and open and save it from there!

> Thanks,
> 
> Roger

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
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