I have been doing some reverse engineering in order to make sense of the parameters and general coding rhythms and movements of this whole area of coding. A rather large stack of code from Bouncy rev I am able to read up about and find in the dictionary, but the beginning of his code I was wanting just to make sure that I am understanding it correctly.
A number of points I wonder if someone could either confirm or correct for me please:
FROM bouncy rev
local tDragging -- true if dragging the window, false if not
local dx,dy -- the current x and y movement variable
local sx,sy -- the current x and y coordinates of the stack
local cx,cy -- the location at which the user clicked in the stack to start dragging
local sx0,sy0 -- when slingshotting, the start x and y
local tMessage -- the id of the message that moves the window
local tSound -- the path to the sound to play when bouncing
local leftBound,rightBound,bottomBound -- the boundaries to bounce within
-- Bouncy 1.0, copyright 2003 by Geoff Canyon
-- geoff@runrev.com
-- http://www.runrev.com
-- gcanyon@inspiredlogic.com
-- http://www.inspiredlogic.com
on openCard -- startup code
setMeUp
end openCard
on setMeUp -- set boundaries, etc.
put the width of this stack div 2 into leftBound
get the screenrect
put item 3 of it into screenright
put item 4 of it into screenbottom
put screenright - leftBound into rightBound
put the height of this stack div 2 into sh
put screenbottom - sh into bottomBound
put "invitation.aiff" into tSound
end setMeUp
The first section at the top at the beginning is where he has declared local variables by defining the names; these names he has invented for his own purpose?
-----------------------------------------------
on openCard
setMeUp
end openCard
"setMeUp" is not in the dictionary nor has he declared it as a variable
So I could say:
on OpenCard
TittywahaRules
end openCard
as long as I tell the scripting engine what "TittywahaRules" means?
Thankyou
regards
chris
want to make sure that I am understanding what I read
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, asayd
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: want to make sure that I am understanding what I read
Hi Chris,
The answer without an explanation is Yes.
On your second point
on OpenCard
TittywahaRules
end openCard
you can do but you must have an
on TittywahaRules
--do something
end TittywahaRules
Go ahead and replace all instances of "setMeUp" with TittywahaRules
Simon
The answer without an explanation is Yes.
On your second point
on OpenCard
TittywahaRules
end openCard
you can do but you must have an
on TittywahaRules
--do something
end TittywahaRules
Go ahead and replace all instances of "setMeUp" with TittywahaRules
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: want to make sure that I am understanding what I read
Ahhh, I missed something you said up there.
Page 123 of the User Guide.
Simon
setMeUp is a "Handler" not a variable (or other)."setMeUp" is not in the dictionary nor has he declared it as a variable
Page 123 of the User Guide.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: want to make sure that I am understanding what I read
Is there another user guide because I have this on page 123
5.1 TheStructureofaScript
5.1.1 What is a Script
no mention about setmeup, which it does not return on entering into search box.
5.1 TheStructureofaScript
5.1.1 What is a Script
no mention about setmeup, which it does not return on entering into search box.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: want to make sure that I am understanding what I read
Keep scrolling down and you'll came across Handlers.
5.4.2 has Custom Commands (which is what setmeup is) and Functions.
Simon
5.4.2 has Custom Commands (which is what setmeup is) and Functions.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!