How to see code without activating it

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

Post Reply
Johngme
Posts: 5
Joined: Wed Jan 29, 2014 3:33 am

How to see code without activating it

Post by Johngme » Wed Jan 29, 2014 3:54 am

Hello,
I am trying out Livecode because I want to create an interactive book. I bought this book called Livecode Mobile Development Hotshot. It seems quite rudimentary - like it was thrown together very quickly - even though it is called Hotshot. The funny thing is that I went to look at the code for one of the example and it causes Livecode to freeze. And if I create a standalone application, it also freezes at the same point. Well, being that I want to know why it is causes these freezes, I want to look at the code. But when I go to the card, the code is activated and it freezes.
How do you look at the code of a project without it being activated?
Thanks for your help,
John

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: How to see code without activating it

Post by dunbarx » Wed Jan 29, 2014 4:08 am

Hi.

How is this book causing a problem with LiveCode? Was there a CD that had stacks on it?

Not aware of this book, but in the IDE, there is a menuItem in the "Development" menu called "Suppress Messages". This will allow you to look around without invoking any messages. It may take a bit more expertise than you have to locate whatever offending code is causing the problem, though.

Stick with us. You will get all the help you need.

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to see code without activating it

Post by FourthWorld » Wed Jan 29, 2014 4:42 am

You might try writing to the publisher to see if they have an update, or can at least put you in touch with someone who can help with the samples included with their book:
http://www.packtpub.com/contact
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Johngme
Posts: 5
Joined: Wed Jan 29, 2014 3:33 am

Re: How to see code without activating it

Post by Johngme » Wed Jan 29, 2014 5:15 am

Thanks for your help. I downloaded the files from the publisher website. This is a very simple program. And the code for this card is pretty much the same as the other cards. The code looks fine. I don't really need to know why it is crashing. (though I do love to figure these things out.)
My question is does Livecode crash easily? If they left out a wave file and the code asked for it, that should stop the file. But would something like that cause Livecode to crash? As I comparing Livecode to other platforms, I am trying to see which would be the best.
I certainly like how easy Livecode is - once you get your head around the stacks idea and where to find the code and all. ;)
Thanks again.

Johngme
Posts: 5
Joined: Wed Jan 29, 2014 3:33 am

Re: How to see code without activating it

Post by Johngme » Wed Jan 29, 2014 7:40 am

Well, I traced it to a wav file. The bit depth of the problem file was only 4 bits - whereas the other wave files were 16 bits. [With that I would not recommend this book. I have some other problems with it as well.]

The fact that a 4 bit file brought down Livecode concerns me - though this is where I am ignorant. I have played before with coding and have never gotten much beyond the beginner level. And so I don't know what's fair to expect.

Should Livecode have given me some insight into the problem? Is it fair to expect that or would other platforms have done the same.

(I looked at the crash log files and they did not seem to help but I really don't know how to read them.)

Any insights and reflections would sure be helpful.

Thanks.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to see code without activating it

Post by FourthWorld » Wed Jan 29, 2014 3:47 pm

I've written one of my contacts at PacktPub to let them know their tech edit for the book missed that item. Hopefully they'll send me or the RunRev team the materials so a proper bug report can be filed, and in the meantime they should be able to correct any issues in their materials themselves so new users have a better experience with both their product and LiveCode.

That said, 4 bits sounds very small - does the file play well in your OS's media player?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: How to see code without activating it

Post by dunbarx » Wed Jan 29, 2014 4:11 pm

In reply to your main question, LC is very stable, your discovery notwithstanding. More so than most.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to see code without activating it

Post by FourthWorld » Wed Jan 29, 2014 5:28 pm

@John: PacktPub replied to my email very quickly, and made both the book and its accompanying materials available to me so I can file a bug report on this. However, I'm unable to find a WAV file at 4 bits - what's the name of the file you saw the trouble with?

And to answer your main question, you can lock messages when opening a stack to review its objects without triggering any of the preOpenStack/openStack/etc messages, e.g., this can be run from the Message Box:

Code: Select all

answer file "Select a stack to review:"; lock messages; open stack it
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Johngme
Posts: 5
Joined: Wed Jan 29, 2014 3:33 am

Re: How to see code without activating it

Post by Johngme » Wed Jan 29, 2014 6:45 pm

Thank you all for your replies.

The offending file is in the folder for chapter 7 supporting files. It is called "monkey.wav". And it does play fine on the computer outside of LiveCode. I am running LiveCode 6.5 on a MacPro with 10.6.8.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to see code without activating it

Post by FourthWorld » Wed Jan 29, 2014 11:43 pm

That file plays in LC for me without issue. What is the recipe I would follow to reproduce the problem?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Johngme
Posts: 5
Joined: Wed Jan 29, 2014 3:33 am

Re: How to see code without activating it

Post by Johngme » Thu Jan 30, 2014 4:19 am

If I double click the source code called jungle.livecode and it opens in LC, then when I click on the monkey to access that stack, it open the stack. Then the spinning beach ball of death arrives, the monkey does not move and I have to force quit LC.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to see code without activating it

Post by FourthWorld » Fri Jan 31, 2014 2:40 am

Confirmed as described, but interestingly that script isn't playing an audio file, but an internal imported clip. When I comment out that line the script works well, and when I re-import the clip after deleting the original the script works fine, though the audio doesn't play.

It seems somehow the original imported clip was corrupted during production, though we're still left with the question of why LC doesn't play that particular clip.

But at least the hang is easy enough to work around, and seemingly unlikely to be easily repeated (I can't even get it to happen when re-importing that clip).

At this point I'll have to wait for the author to get in touch with me so we can pin down details for a bug report, but at least you should be able to just comment that line and move on with the rest of the exercises in the book.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply