start using?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
start using?
I have added a stack that I utilize as library to the Standalone Application Settings->Stacks dialog and verified the file is NOT in the APK should it be there? Tried load it anyway as shown below and get my error dialog. Suggestions?
try
start using "libXyz"
catch _e
answer error "Unable to load 'libXyz'" with "OK" titled "Error loading library"
end try
try
start using "libXyz"
catch _e
answer error "Unable to load 'libXyz'" with "OK" titled "Error loading library"
end try
Re: start using?
Hello,
Yes it should be there and the correct syntax is "start using stack <stackname>" instead of "start using <stackname>".
Kind regards,
Mark
Yes it should be there and the correct syntax is "start using stack <stackname>" instead of "start using <stackname>".
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: start using?
@Mark The syntax ...
functions on Linux, Windows and OSX as I have utilized it on all in production code. In the event that Android is different I attempted the syntax you provided and received the same error.
Again I am unable to locate the file in the APK.
FYI: I am using 5.0.2 (fully licensed for Windows, Linux, Mac OSX and Android) it is what was formerly a Enterprise Version (Windows,Linux,OSX). The majority of my applications are Linux driven by Windows client program also written in RR. I am attempting to create a Android client as we are expanding our support.
Code: Select all
try
start using "libBasics"
catch _e
answer error "Unable to load 'libBasics'" with "OK" titled "Error loading libraries!"
end try
functions on Linux, Windows and OSX as I have utilized it on all in production code. In the event that Android is different I attempted the syntax you provided and received the same error.
Code: Select all
try
start using stack "libBasics"
catch _e
answer error "Unable to load 'libBasics'" with "OK" titled "Error loading libraries!"
end try
FYI: I am using 5.0.2 (fully licensed for Windows, Linux, Mac OSX and Android) it is what was formerly a Enterprise Version (Windows,Linux,OSX). The majority of my applications are Linux driven by Windows client program also written in RR. I am attempting to create a Android client as we are expanding our support.
-
- VIP Livecode Opensource Backer
- Posts: 7255
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: start using?
I'd continue to use the "stack" syntax, it will work on any platform and is the correct form. If the file really isn't included in the build at all, the standalone builder may not be able to find it. Try putting the library stack into the same folder as your main stack and reselect it in the SB before building again.
If that works but the library still doesn't load, then try providing a full path to the stack, which will be relative to the engine:
start using stack specialFolderPath("engine") & "/libBasics.lc"
or whatever its name and path is on disk, including the extension.
Personally I'd just add the library as a substack of the mainstack, and it will be found for sure without any path or inclusion issues.
If that works but the library still doesn't load, then try providing a full path to the stack, which will be relative to the engine:
start using stack specialFolderPath("engine") & "/libBasics.lc"
or whatever its name and path is on disk, including the extension.
Personally I'd just add the library as a substack of the mainstack, and it will be found for sure without any path or inclusion issues.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Hello all,
OK now I'm having trouble with this on Android.
I have that in the openStack script and the file is in the Copy Files panel.
PHMData.livecode only contains 3 custom properties that I intend to read/write/save.
Everything works great on the desktop but once in Android I'm getting errors (91 is the first).
All of this is tested with an empty stack with just the above.
Thanks for any help,
Simon
Edit Win 7 LC 6.5.1 rc 1 and 6.5
OK now I'm having trouble with this on Android.
Code: Select all
put url ("binfile:" & specialFolderPath("engine") & "/PHMData.livecode") into \
url ("binfile:" & specialFolderPath("documents") & "/PHMData.livecode")
set the defaultFolder to specialFolderPath("documents")
answer the files --This does show that PHMData.livecode is in the documents folder
start using stack "PHMData.livecode"-- Have also tried (specialFolderPath("documents") & "/PHMData.livecode")
PHMData.livecode only contains 3 custom properties that I intend to read/write/save.
Everything works great on the desktop but once in Android I'm getting errors (91 is the first).
All of this is tested with an empty stack with just the above.
Thanks for any help,
Simon
Edit Win 7 LC 6.5.1 rc 1 and 6.5
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: start using?
Hi Simon,
What is the problem exactly? Doesn't your stack appear in the stacksInUse? Perhaps you are unable to save the stack? You might want to check the result after the start using command.
Kind regards,
Mark
What is the problem exactly? Doesn't your stack appear in the stacksInUse? Perhaps you are unable to save the stack? You might want to check the result after the start using command.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Hi Mark,
Thanks for replying.
I just put an "answer the result" after the "start using" and it never gets that far (no answer dialog).
Oh yes I do have an "on errorDialog" giving me
91,11,13
568,11,1
253,2,1
241,2,1
I did look them up 91 gives "Chunk: can't find stack"
Any other ideas?
I'm stumped.
Simon
Thanks for replying.
I just put an "answer the result" after the "start using" and it never gets that far (no answer dialog).
Oh yes I do have an "on errorDialog" giving me
91,11,13
568,11,1
253,2,1
241,2,1
I did look them up 91 gives "Chunk: can't find stack"
Not sure what you mean by that? The stack is there.Perhaps you are unable to save the stack?
Any other ideas?
I'm stumped.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Ah a hint!
"stack was produced by a newer version"
But both stacks are made and saved with liveCode 6.5
Simon
Code: Select all
try
start using stack (specialFolderPath("documents") & "/PHMData.livecode")
catch _e
answer the result
end try
But both stacks are made and saved with liveCode 6.5
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: start using?
Hi Simon,
Maybe it is a LiveCode bug? For now, you could try to save your stack in an older format. It is also possible that the stack is corrupted when you save a copy of it in the documents folder. It might be insightful to check the actual path to the stack:
Kind regards,
Mark
Maybe it is a LiveCode bug? For now, you could try to save your stack in an older format. It is also possible that the stack is corrupted when you save a copy of it in the documents folder. It might be insightful to check the actual path to the stack:
Code: Select all
put (specialFolderPath("documents") & "/PHMData.livecode") into myPath
if there is a file myPath then
if there is a stack myPath then
start using stack myPath
put the result into rslt
if rslt is not empty then
answer error rslt
end if
else
answer error "Can't find stack" && myPath
end if
else
answer error "Can't find file" && myPath
end if
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Thanks again Mark,
I did try saving PMHData.livecode in a legacy format, still no joy.
With your addition it says the file is there but the stack is not... Which means??
I've attached the 2 stacks for testing.
Simon
I did try saving PMHData.livecode in a legacy format, still no joy.
With your addition it says the file is there but the stack is not... Which means??
I've attached the 2 stacks for testing.
Simon
- Attachments
-
- startUsing.zip
- LC 6.5
- (2.21 KiB) Downloaded 204 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 7255
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: start using?
Could this be due to a password-protected stack that the community version can't open?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Hi Jacque,
Thanks for looking into this.
Both stacks were made with the commercial version. No passwords.
Can't find a bug report on it.
Simon
Edit; filed report Bug 11622
Thanks for looking into this.
Both stacks were made with the commercial version. No passwords.
Can't find a bug report on it.
Simon
Edit; filed report Bug 11622
Last edited by Simon on Sat Dec 21, 2013 5:21 am, edited 1 time in total.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: start using?
Hi Simon,
you said there are no script in that stack, just some custom prop you want to save data in?
Then you don't need to "start using" it! (Maybe LC will choke on a missing script to "use" here?)
Just set and get these props and save the stack when closing the app:
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
set the cWhateverprop of stack the_StoreStack to "Some data..."
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
put the cWhateverprop of stack the_StoreStack into fld "data from CP"
...
Save and close when doen:
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
save stack the_StoreStack
close stack the_StoreStack
## quit...
...
When you address a stack(file) on disk this way, LC will invisibly open the MAINSTACK of that
stackfile as the target for all commands/set/getprop without triggering any mesages like "openstack" etc.
Maybe that works for you or did I misunderstand you completely?
Best
Klaus
you said there are no script in that stack, just some custom prop you want to save data in?
Then you don't need to "start using" it! (Maybe LC will choke on a missing script to "use" here?)
Just set and get these props and save the stack when closing the app:
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
set the cWhateverprop of stack the_StoreStack to "Some data..."
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
put the cWhateverprop of stack the_StoreStack into fld "data from CP"
...
Save and close when doen:
...
put specialFolderPath("documents") & "/PHMData.livecode" into the_StoreStack
save stack the_StoreStack
close stack the_StoreStack
## quit...
...
When you address a stack(file) on disk this way, LC will invisibly open the MAINSTACK of that
stackfile as the target for all commands/set/getprop without triggering any mesages like "openstack" etc.
Maybe that works for you or did I misunderstand you completely?
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: start using?
Hi Klaus,
I did try your method of "not using ... using" but while the file is found the stack is not.
Yes, it's just a data stack to hold some arrays, works fine on the desktop but not on a device or sim. I tried adding non-interrupting code to the openStack and openCard scripts to try and make it look more like a normal stack but that didn't help.
While I'm not giving up; is there a way to arrrayEncode several arrays to 1 file? (and decode them for output).
Thanks,
Simon
No, you got it spot on.did I misunderstand you completely?
I did try your method of "not using ... using" but while the file is found the stack is not.
Yes, it's just a data stack to hold some arrays, works fine on the desktop but not on a device or sim. I tried adding non-interrupting code to the openStack and openCard scripts to try and make it look more like a normal stack but that didn't help.
While I'm not giving up; is there a way to arrrayEncode several arrays to 1 file? (and decode them for output).
Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: start using?
Hi Simon,
very strange, maybe a Android issue of some sort?
...
urlencode(base64encode(arrayencode(Your_Array1)))
...
And vice versa for decoding
Best
Klaus
very strange, maybe a Android issue of some sort?
You could store them in one line each in a text file:Simon wrote:While I'm not giving up; is there a way to arrrayEncode several arrays to 1 file? (and decode them for output).
...
urlencode(base64encode(arrayencode(Your_Array1)))
...
And vice versa for decoding
Best
Klaus