PC standalone from Mac ignores commands/functions/globals

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

PC standalone from Mac ignores commands/functions/globals

Post by ajrush » Sat Nov 03, 2007 2:09 pm

I'm running Studio 2.8.1 on an Intel Mac with 10.4.10. I've created a pretty complicated complication (kudos for the learning curve, BTW) which runs and compiles as a standalone just fine on a Mac. In fact, I'm ready to post the public beta, but wanted to post the Mac & PC versions simultaneously.

The Windows version opens in XP SP2 (in the latest build of Parallels, on the same Mac), but only one or two of my scripts run. Generally speaking, scripts which are called by a mouseUp or menuPick handlers and which are contained entirely within that handler (not calling any other procedures which are in other stacks/cards) seem OK. Global variables or procedure calls are simply ignored.

I tried just running the stack file in XP SP2 using the Player and got identical results.

I then tried building the standalone the bug reporting option turned on. I got a dialog box every time things didn't work right, but no edifying error codes.

It strikes me that for such a consistent bug I must have missed something fundamentally different between Macs & PCs: Perhaps the PC version doesn't allow sharing globals across stacks in the same stack file, or the procedure (aka command/function) needs to specify the card/stack in which procedure may be found, or variables have to be declared differently, or "on openStack" handlers don't exist, or something like that?

Any suggestions? I looked on the forums and didn't find any similar problems.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Nov 03, 2007 3:58 pm

Hi ajrush,

Could you please post any error information you've got?

Best,

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

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

there isn't any error info

Post by ajrush » Sat Nov 03, 2007 5:21 pm

That's the annoying part of it. No error info at all. It's just that nothing happens, as if the parts of the scripts which use globals or procedure calls weren't there at all.

I tried compiling the standalone with the error reporting on, but it just says that there's an error, but doesn't give any additional info. Unless there's a further error capture and reporting method for standalones of which I'm unaware?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Nov 03, 2007 5:46 pm

Hi ajrush,

You could try errorLib, which you can download from
http://economy-x-talk.com/developers.html

If you send me an e-mail (see profile) I'll send you a license.

Could you describe what the non-working scripts are supposed to do?

Best,

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

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

what the scripts are supposed to do...

Post by ajrush » Sat Nov 03, 2007 6:59 pm

The first script which should be run is an "on openStack" handler in the main stack which opens up another stack (the About window). The main stack opens, but not the About stack.

The same About window CAN be opened, however, by clicking on the "About" button in the main stack. Seems to be a handler problem.

Similarly, when an "on mouseUp" handler is supposed to perform a script it does all the script steps in the handler per se, but when a procedure call ("commands" in Transcript) nothing happens. By the way, all of my procedures are in the stack script. Seemed like the most logical place to leave them, though I'm not sure that it would matter at all to RR where I put them.

The really weird thing is it all works fine on Mac (story of my life).

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

errorLib doesn't work on PC, either

Post by ajrush » Sat Nov 03, 2007 9:29 pm

Okay, this is getting pretty annoying. As a test, I followed the instructions for errorLib and added a button to my stack with your "a"*2 example. (the initialization was in an "on preOpenStack" handler) On my Mac, I then opened up first errorLib and then my stack with Player. I clicked on the button which was supposed to create the error... and it did, just as planned.

I then repeated the exact same procedure with the PC version of Player. Both stacks opened just fine, but my stack didn't even try to initialize errorLib. Again, this says to me that certain handlers just don't work on the PC.

I'm going to try the same thing again now with a really small and simple stack.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Nov 03, 2007 9:51 pm

Ajrush,

Are you using file paths, anywhere? Do you make sure that the file paths are adjusted to the platform the standalone is running on, if needed?

Best,

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

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

no file paths

Post by ajrush » Sat Nov 03, 2007 10:00 pm

Nope. No file paths.

I've been trying some simple tests with errorLib using Player. On a Mac, it doesn't matter in what order I open the stacks "testing" (original, I know) and "errorLib". I've got a button that initializes errorLib in the testing stack and another that intentionally creates an error. Everything works fine.

On the PC "testing" doesn't see "errorLib", regardless of which I opened first. errorLib is open, I can see it there on the screen, but regardless of what handler I use to initialize errorLib it just doesn't work. NOTHING happens.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Nov 04, 2007 12:16 am

ajrush,

If I understand you correctly, the preOpenStack and openStack handlers never run on Windows. Could you make a stack with only the following simple script:

Code: Select all

on preOpenStack
beep
answer "PreOpenStack is running" with "Okay"
end preOpenStack
and tell me if it works on Windows?

Which "Player" are you using, exactly?

Note that the unregistered version of errorLib only runs for an hour. To keep using it without quitting Revolution all the time, you need a license, which I'll send you if you send me an e-mail.

Best,

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

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

Rev Player 2.7.1

Post by ajrush » Sun Nov 04, 2007 12:40 am

Mark--

Looks like Rev Player 2.7.1

I sent the email a while ago, and attached the .rev file in question--please check your spam folder.

errorLib's impressive, BTW

I tried the script you suggested and it worked fine, as did an "on openStack" version.

What on Earth might there be about a stack file that would make it disregard certain handlers under Windows but behave normally under MacOS?

--AJ

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

same thing happens in PC version of Studio 2.8.1

Post by ajrush » Sun Nov 04, 2007 1:00 am

Mark--

I downloaded a demo version of Studio 2.8.1 for the PC (same version as I'm using on the Mac). I opened my stack (the one I sent to you) and the exact same errors are happening.

However, I was able to get some insight: I clicked on button whose "on mouseUp" handler has a long script. That script performs some actions and then calls a procedure which is in the stack script. Everything up to the point where the procedure in the stack script should have been called, but then I got a "can't find handler" error.

I tried the same thing on some other buttons and got identical results.

To me, this says that the stack script of my main stack of my stack file is being entirely ignored. On the up side, once I (we? you? somebody at Revolution?) figures out why this happens then all my problems will probably go away together. On the down side, I haven't a clue why this has happened.

I'll try calling a procedure which is in a different sub-stack's stack script and see if that enlightens me...

--AJ

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

sub-stack's scripts okay, but can't be called from main

Post by ajrush » Sun Nov 04, 2007 1:08 am

I made up a procedure or two in the stack script of one of the sub-stacks. Tried calling it from an "on mouseUp" handler on a button on that same sub-stack. Worked fine.

Tried calling it from an "on mouseUp" handler on a button on the main stack. Didn't work; got a "can't find handler" error.

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

hmm, maybe that wasn't so enlightening after all

Post by ajrush » Sun Nov 04, 2007 1:14 am

I tried the dummy scripts I just described on a Mac. They worked exactly the same way as on the PC: I could call the procedure in the sub-stack's stack script from a button within that stack, but I could not call that procedure from a button on the main stack.

That sort of makes sense, that you can't call scripts on a sub-stack from a control on the main stack.

Doesn't get us any closer to knowing why I can't call procedures in my main stack's stack script from buttons on that stack, though.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Nov 04, 2007 1:45 am

Hi ajrush,

I had a quick look at your stack. Your mail went into the spam box because you didn't incude a subject header.

It appears that you are using symbols such as ≥, ≤ and ≠. Windows can't compile scripts with these symbols and thus you'll get an error saying "Can't find handler" --if error reporting worked properly.

If you replace aformentioned symbols with >=, <= and <>, your stack should run fine.

Best,

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

ajrush
Posts: 12
Joined: Fri Nov 02, 2007 8:30 pm
Contact:

I reviewed the object hierarchy...

Post by ajrush » Sun Nov 04, 2007 1:50 am

On reviewing the concept of hierarchy in RR, it's obvious why trying to call a procedure which is in a sub-stack from a main stack won't work.

Of course, it doesn't explain why all the scripts in the main stack stack script are ignored, but scripts attached to objects work fine so long as they don't call one of the stack script's procedures.

Unless... is there any way that a file could be corrupted in such a way that a PC version of RR "thinks" that the stack script is elsewhere in the hierarchy, but that the Mac version behaves normally?

Or perhaps it's something about the content of the stack script itself. The first five or six lines of the stack script are global declarations. Maybe PCs like having those elsewhere in the script? As I recall from the manual, Transcript doesn't care where in the script the globals are declared. I'll try moving them around tomorrow.

Post Reply

Return to “Windows”