desktop and standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 151
- Joined: Sat Aug 25, 2012 1:14 am
Re: desktop and standalone
Thank you.
I think the problem is getting the file into the documents/sandbox. Currently I am using this code at startup:
If there is not a file (URL "file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") then
put empty into URL ("file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt")
end if
I think the problem is getting the file into the documents/sandbox. Currently I am using this code at startup:
If there is not a file (URL "file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") then
put empty into URL ("file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt")
end if
Re: desktop and standalone
That could certainly be the problem. I ran into the same thing recently and there is no way currently to access the public device folders. I've submitted a feature request for it.With respect to the mobile build: How are you getting the text file into the mobile sandboxed Documents folder? I wonder if this is the problem you're having?
One workaround for now is to upload the file to a server and then have the app download it. Or you could copy the text to the clipboard with a text editor and have the app get it from there. Neither method is suitable for a professional app.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: desktop and standalone
Looks wrong, I don't think you need to mix the file and URL syntaxtyarmsteadBUSuSfT wrote: ↑Sat Jul 09, 2022 4:33 pmIf there is not a file (URL "file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") then
Code: Select all
If there is not a file (specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") then
Re: desktop and standalone
1: The OP is looking to import a text file - the URL syntax is correct as per the documentation: 2: The issue is how to access a text file on mobile, as actually this is the sticking point. AFAIK, LC does not offer an API for general non-sandboxed files folder (which does exist at least for iOS, i presume for Android as well). The other option is to get this from a web service - either an API or storage like Dropbox (or copy it to clipboard).
The real question is how does the OP plan to derive the text file? is it something generated inside the app? If it's user-entered with the app, you can just use the sandboxed Documents folder of course, but otherwise need another way to get the text data in. It really depends on the OP's planned workflow...
Re: desktop and standalone
Hi stam,
Klaus
true, but Sparkout meant the syntax for checking the existence of that file:
BestSparkOut wrote: ↑Sat Jul 09, 2022 9:15 pmLooks wrong, I don't think you need to mix the file and URL syntaxtyarmsteadBUSuSfT wrote: ↑Sat Jul 09, 2022 4:33 pmIf there is not a file (URL "file:" & specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") thenCode: Select all
If there is not a file (specialFolderPath("documents") & "/CarBuildApp" & "/Receipt.txt") then...
Klaus
Re: desktop and standalone
I stand corrected, Sorry Sparkout!!!
I didn’t see the OPs further post, just the original code.
On that point (now that I actually read the post sparkout was responding to
), not sure why the OP would need to create an empty file if one doesn’t exist? I can’t imagine that serves a purpose?
Check the file when populating the data grid, if it snempty then data grid will be empty, if not populate it. Can’t see a reason for creating an empty file?
All the OP would need to do when reading data in the data grid is start with
Or even better, just use the existing code as is with a different modification: check the result after trying to read the file and if this shows an error then pout empty into dgData - should catch any file IO error…
In trying to help the OP, this point still stands however:
I didn’t see the OPs further post, just the original code.
On that point (now that I actually read the post sparkout was responding to

Check the file when populating the data grid, if it snempty then data grid will be empty, if not populate it. Can’t see a reason for creating an empty file?
All the OP would need to do when reading data in the data grid is start with
Code: Select all
If there is not a file (<fikepath, not URL>) the
Set the dgData of group “<data grid name>” to empty
Exit to top
End if
In trying to help the OP, this point still stands however:
stam wrote: ↑Sun Jul 10, 2022 12:24 pmThe real question is how does the OP plan to derive the text file? is it something generated inside the app? If it's user-entered with the app, you can just use the sandboxed Documents folder of course, but otherwise need another way to get the text data in. It really depends on the OP's planned workflow...
-
- Posts: 151
- Joined: Sat Aug 25, 2012 1:14 am
Re: desktop and standalone
Thank all for the input. Yes my issue s when the user saves data, I need it to save to the file then when the user goes to the data grid card they are able to see the list of their saved data. The reason I was creating a file ate startup I did, t thing LC would create the file when the user first saved the first entry. I tried to copy the file as part of the standalone settings but I still could not retrieve the data. Should I have copy the files and then used "engine" instead of "documents"
Thank you
Ty
Thank you
Ty
Re: desktop and standalone
1) don't use specialFolderPath ("engine") - instead, use specialFolderPath ("resources")
2) specialFolderPath ("resources") (or 'engine') is a read only location, so if you need to save updates, you should copy it to specialFolderPath ("documents") on first run. This is where you should check for the existence of the file in "documents" and if not there, then copy from "resources".
2) specialFolderPath ("resources") (or 'engine') is a read only location, so if you need to save updates, you should copy it to specialFolderPath ("documents") on first run. This is where you should check for the existence of the file in "documents" and if not there, then copy from "resources".
-
- Posts: 151
- Joined: Sat Aug 25, 2012 1:14 am
Re: desktop and standalone
Thank you, I'll give it a go.
Thanks all. of you for the help esp. on a weekend.
Ty
Thanks all. of you for the help esp. on a weekend.
Ty