Hmmm, more food for thought. I'm starting to think that the installer will need to prompt the user to select the location for the database and then just store that information in a file that the app can load and use. I've been doing more non-GUI system work the last couple of decades so I'm having to refresh how I think about design and deployment issues. So. much. fun.bogs wrote: ↑Mon Feb 25, 2019 7:57 pmAbsolute paths, absolutely!
Kinda kidding, but Klaus does have a point. The lessons I linked to were more than I do when looking for paths, except in certain circumstances. MOSTLY, they are just very thorough.
As a couple of examples, lets say I had a folder my app is in, and wanted to go one more folder relative to that one, so the path looks like ~/myApp/Data (we don't know where the folder is sitting, it could be anywhere the user has permission to put it, home, docs, etc).
Klaus would (properly) never let that situation happen, but lets say it does for whatever reason. To work out where the Data folder was, I would probably put the fileName into a variable, cause I know it is in the base folder I want, then add the relative part of the path to get to Data -
Selection_005.png
(Not shown in the picture is that tmpPath is a script local variable outside of the handlers )
Now, something like this wouldn't work too well on OSX, certainly if the fileName your grabbing is inside the app folder, but for Win or Lin it is suitable to most purposes.
Klaus rightly pointed out specialFolders, which there are quite a few of now, and which resolve *most* issues (Richard and I recently learned of a case where they don't, as in someone changes their "Documents" folder name to something else ) so error checking no matter which way you go should be done no matter what.
Hope that helps clear it up a bit more
SQLite Questions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: SQLite Questions
Re: SQLite Questions
Well, not to overload you, cause I know coming in can take a while, but if you write the installer you'll already be able to grab the 'where did it go' info. As well, LiveCode allows for a 'splash stack' technique if you'd rather not write out a separate file. Splash stacks launch the working stack files, so the splash stack is in effect the 'exe' file, and the stack is just an ordinary binary file which can be used to hold information.
The above isn't to say there is anything wrong at all with storing stuff in an ordinary flat file, just food for thought while your munching away
Re: SQLite Questions
In the Stack script.Where are you putting the preOpenStack/closeStack handlers?
Click Object in the Menu then click Stack Script
You could see it as the mothercard for the stack. (or the box containing the cards)
First the Stack is opened and then the first card, but what you see is the first card.
Make sure that you put this
Code: Select all
global gLocalDbID
Code: Select all
on preOpenStack