Having trouble building an app

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Fri Jan 01, 2021 9:28 am

I have something that is probably hugely relevant to this and may be the answer to this question.
I have been looking at the icons on these stack and while they appear to be LC icons, all of the files that I have described as working and the successful apps I have built with them as I described are all .Rev files.
I had thought that at least one of the latest were LC files.
So it seems me that LC didn't keep the option to build this way, which to me begs the question "Why have a setting "Move Substacks into individual stackfiles""?

I still have have of the examples I had intended to send, but now wonder if the super heroes of LC would be interested in seeing Revolution files.
I really did believe that all of Revolution had been included in LC.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Fri Jan 01, 2021 5:29 pm

I'm not sure I understand the question here, if you have one.

If your asking about a historical view of the IDE, it started as MetaCard, which was later (around vers. 2.5) bought by RuntimeRevolution Ltd., which was shortened to Revolution, which then changed to LiveCode (around version 4.5 or so).

Each IDE creates stacks with the extension of the name of the IDE at the time, i.e. -
Metacard = extension .mc
Revolution = extension .rev
LiveCode = extension .livecode

MetaCard can only open .mc files (either developed in the Mc IDE, or files with the extension from the earliest Rev IDE renamed to .mc).
Every IDE from there on can open files from the previous IDE(s), and all IDE(s) can save backwards for several iterations.

Of course, the catch on saving backwards is that if you were using features introduced *after* the version you are saving backwards too, those features of course will not work with the older engine. Also, you may have to save backwards in steps as well, i.e. -
The current IDE (9.6) I believe has problems saving backwards past vers. 7.x (unconfirmed, this is my suspicion).
With 7.x., I would not try to save backwards past 5.5.
with 5.5, it should** be possible to save back to 2.x.
I've never tried going pas that, so caveat emptor

To sum up, as far as I know, you should have no problem compiling any file with a .rev extension from the current Lc IDE.
- a few caveats to the above -
I work mostly in the ancient MetaCard IDE, not the current one.
I do use the current one on rare occasions to test my theories, or to answer questions about the new IDE specifically, or to test for bugs. YMMV.
Image

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Fri Jan 01, 2021 6:45 pm

My question is "Why can I not build an application with LC in the same manner I did for years using Revolution 4.0"?
That manner began with a mainstack, and added substack, a means of navigating from the main stack to the substack (usually via a button script) and whatever fields and other objects the substack may contain.

Upon building the application, I select "Move substacks into individual stackfiles"
I select create folder for stackfiles.

In Revolution, the stack builder would run, finish and upon opening the app file, navigating to the substack,and doing any editing on the substack, those edits would save until the next time I opened the file.
I have applications built that way that are still working fine, some after nearly 20 years. The last one built in 2006.

I cannot build an application using the same method with Livecard. I am told it cannot be done.
I had thought Livecard had incorporated all of Revolution, but it seems to not the case.

That is as clear as I can make it my question.
I had planned on installing 9.0 or earlier to try it, but I did not find a 64 bit version before 9.5.
LC 9.5 gave me the same results with either new stacks built in LC or older Rev stacks.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Fri Jan 01, 2021 10:34 pm

oldummy wrote:
Fri Jan 01, 2021 6:45 pm
I had planned on installing 9.0 or earlier to try it, but I did not find a 64 bit version before 9.5.
LC 9.5 gave me the same results with either new stacks built in LC or older Rev stacks.
I'm not quite sure why a 32 bit version would stop you from carrying out your play to test in an earlier version (?), but the question I initially came in on was which stacks to post here for someone to dissect. As far as I know, and as I stated previously, LiveCode 9.x should well be able to compile anything you made in a previous version or current version, with substacks, with substacks moved into their own folder.

I'll go back to the first page of this thread and read from there, as I currently have the afternoon off, and come back if I can think of anything someone else hasn't already thought of (but at 3 pages, i certainly doubt that).

BBIAB (possibly hours, if I actually test on win 10).
Image

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Sat Jan 02, 2021 12:13 am

Ok, I didn't quite read the entire 3 pages, in fact, I only got to your post which said -
My mainstack is "Blood Sugar" and the substack is "Blood Sugar Record"...In the card script of the main stack is the following:
{the code you posted...}

The only other script in the stack is the one button that takes me to the stack where my readings are recorded. It is simply:
{the code you posted...}

In the development environment all works as it is supposed to.
When I build the application,clicking the "Go to Record" button does nothing.
The substack is in the data folder as it should be, the application is where it is supposed to be.I can open the substack in the development mode and it works, but when I open the application and try to get to the substack, it does nothing.
I have looked for typos and extra spaces but can find nothing.
-- so I recreated the project as you laid it out, in a Win10 Vm, with 9.5. Here is what I think is going on (in no particular order) :
1.) this has nothing to do with your code.

2.) going through the project exactly as you stated, with the 2nd stack as a substack and using the standalone settings to separate the two, it failed to bring up records from the Data folder. As a side note, using the standalone settings to separate the two resulted in the records stack being given the extension ".rev", which I found pretty odd.

3.) I tested back to 8.1.9 and found the behavior to be the same, so this is an ongoing bug in the standalone settings.

4.) At this point, I changed the substack to be it's own mainstack and saved it in the project folder by creating a sub-folder named 'Data' and saving it there. As you can see, 3 attempts were made with the previous configuration.
Image

5.) I changed the standalone settings to use "Add Stack File", and browse manually to the records file. You see the result here -
Image

The standalone worked with this configuration and displayed no issues, SO, my best guess if you want to keep doing it the way you were doing (which *should* work, but apparently does not now), you have 1 of 3 options.

Either make the substack a mainstack and do as I did, adding it back through standalone settings, OR you can code the button manually to show the path to the records stack if you really need it in a separate folder, OR, you can skip sticking the records stack into the data folder, instead leaving it as a subStack of your programs mainstack.

Hopefully the above is of some help to you.

*Edit 1 - I finally caught up to the reason you want to keep the records separate from the rest of the program, saving the stack as a main stack into Data now makes sense. It will retain whatever you put into it if saved that way (as a stack, not as part of the executable).

*Edit 2 - I have now finished completely reading this thread from beginning to end. I am shocked I did not know this, Richard, you wrote a book ?
Image

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Sat Jan 02, 2021 1:25 am

In the pursuit of finding out where this bug was introduced, I got the standalone setting of moving the substack to a separate file in the previously mentioned "Data" folder through the standalone settings to work in Lc 8.01.

It did *not* work in 8.1.2, so it looks like that is where the bug starts.

Has anyone else submitted a bug report for this yet?

*Edit - I was not able to find one in the qdb as of yet. If anyone else knows of one, please post it, otherwise I'll post a bug rep. myself tomorrow. HAVE A GREAT NEW YEAR ALL :D
Image

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sat Jan 02, 2021 7:41 am

Thank you. I had gotten away from scripting anything for a few years when I began this little project, but I feel certain I was using LC successfully in this manner before and was surprised upon seeing all the successful builds with the .rev extension on them.
when I looked for them.
As soon as I can sort out how to accomplish the method you have told me, I will give it a try.
As far as my mention of Gaskin's book I feel certain now that I gave the credit to to wrong person. Sorry. I believe the book I had in mind was written by a fellow named Dan (something) Both were and are I hope still helping dummies like me. The book I had in mind was the hypertalk reference manual.
Thank you again. I was beginning to believe I had either lost my mind or had indeed stepped into some kind of other continuum as no one seemed to remember this method of building a standalone.
BTW, I had tried the 9.0 installer but it had generic file icon and asked me what to open it with when I attempted to open it. I assumed it was because it was 32 bit.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Sat Jan 02, 2021 12:18 pm

oldummy wrote:
Sat Jan 02, 2021 7:41 am
As soon as I can sort out how to accomplish the method you have told me, I will give it a try.
I'll set up a video for you, you'll see it isn't very hard at all.
oldummy wrote:
Sat Jan 02, 2021 7:41 am
As far as my mention of Gaskin's book I feel certain now that I gave the credit to to wrong person. Sorry. I believe the book I had in mind was written by a fellow named Dan (something) Both were and are I hope still helping dummies like me. The book I had in mind was the hypertalk reference manual.
Heh, well, it explains why I didn't find it :D
Image

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sat Jan 02, 2021 12:58 pm

I just built a standalone and it works just fine. I didn't use the data folder ( not sure why I ever did).
Thanks to all for your help. This was getting me far too frazzled. A project this simple I could have simply used a logfile created in notepad, but using stacks make things expandable.
I cannot say thanks to often,Bogs.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sat Jan 02, 2021 1:04 pm

Dan Shafer: "Revolution: Software at the Speed of Thought"

Not much sign of either Dan Shafer or his book for a very long time.

This: http://shafermediastore.com/tech_main.html is no longer available.

Last seen in 2010: https://web.archive.org/web/2010*/http: ... _main.html

And, Yes, before you ask, I have trawled the net for pirated PDF versions, and found nothing.

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sat Jan 02, 2021 1:38 pm

Seems that I have another issue with this, hopefully an easier explanation.

I added a field"record" and a button to enter my data.
The button script is as follows:

on mouseUp
ask "What is the reading?"
put it & "---" &the date&"---"& the time & cr after fld "record"
end mouseUp


The ask dialogue never shows but as soon as I click the button this shows up in the field exactly as shown here.

ask plainWhat is the reading?false---1/2/21---7:18 AM

It seems to me this script should work.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Having trouble building an app

Post by bogs » Sat Jan 02, 2021 4:11 pm

oldummy wrote:
Sat Jan 02, 2021 12:58 pm
I just built a standalone and it works just fine. I didn't use the data folder ( not sure why I ever did).
In almost all cases, it is better to separate the information your program uses from the main program itself, the main question you really need to answer is where the various parts should be located.

In the olden days of yore, I would have setup my folder structure much as you have in the beginning of this thread, with all sub folders being in the main folder. These days however, it is often a wiser course to have your main program data in the user's documents folder, especially if you are deploying to multiple systems.

In the case where you are developing this solely for yourself and know you won't use it on anything else, you might still organize your folder structure just to differentiate the various files that make up the program, however I'll leave that call to your own judgement :wink:

I went ahead and made the work around video, just in case anything I said in the previous post wasn't clear. You can view that here.
oldummy wrote:
Sat Jan 02, 2021 1:38 pm
I added a field"record" and a button to enter my data.
The button script is as follows:

Code: Select all

on mouseUp
   ask "What is the reading?"
   put it & "---" &the date&"---"& the time & cr after fld "record"
end mouseUp
The ask dialogue never shows but as soon as I click the button this shows up in the field exactly as shown here.

ask plainWhat is the reading?false---1/2/21---7:18 AM

It seems to me this script should work.
The script is working exactly as you wrote it here, I simply copied and pasted it into the script for the button as you see here --
aPic_ask.png
Did you ask me something?
Not sure why you wouldn't see the same result :?:
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sat Jan 02, 2021 4:19 pm

Well, your script worked after I popped a few spaces into it:

Code: Select all

on mouseUp
   ask "What is the reading?"
   put it & "---" & the date & the time & cr after field "record"
end mouseUp
But the result looked pretty ugly:
-
Screenshot 2021-01-02 at 17.14.42.png
-
Mainly because you used single ampersands instead of double ones:

Code: Select all

on mouseUp
   ask "What is the reading?"
   put it && "---" && the date && the time & cr after field "record"
end mouseUp
-
Screenshot 2021-01-02 at 17.18.03.png
-
Attachments
SUGAR.livecode.zip
Here's the stack.
(1.01 KiB) Downloaded 243 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sat Jan 02, 2021 5:01 pm

Dan Shafer died in 2017.

https://www.danshaferlegacy.com/books

https://www.facebook.com/onemindfellowship

If you can work out how programming LIveCode and being some sort of guru go together you're a better
person than I am.

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sat Jan 02, 2021 8:04 pm

Thanks. This is the trouble I expected to have with years away from coding. Remembering little things.
Sorry to hear about Dan Shafer.
And thank you.

Post Reply