lingo-l Minor lingo questions

2004-09-06 Thread Petro Bochan
Hello folks,

I've got these simple questions that i've encountered while working with
Director 8.

1. About lists. Let's say i've got a bunch of hefty #bitmap members in my
cast and i made up my mind to add them all to a linear list to easily
manipulate them. As far as i understand, Lingo manages lists entirely in
RAM, so i wonder, will a lingo list duplicate all tose members in memory or
just create references to them (in RAM of course) and that way manipulate
them?

2. About variables. I started to read www.director-online.com articles to
fortify my knowldege of Director. From time to time i come across these
statements in articles: ...try to use variables So what's the
difference:

on exitFrame me
  set the locH of sprite the spriteNum of me to the locH of sprite the
spriteNum of me + 1
end

(watch for line wrap)

and

on exitFrame me
  set aSprite to the spriteNum of me
  set aLocH to the locH of sprite aSprite
  set aLoc to aLoc + 1
end

Another exmaple:

on exitFrame me
  set the scrollTop of member the member of sprite the spriteNum of me to
the scrollTop of member the member of sprite the spriteNum of me + 1
end

(watch for line wrap)

and

on exitFrame me
  set aSprite to the spriteNum of me
  set aMember to the member of sprite aSprite
  set the scrollTop of aMember to the scrollTop of aMember + 1
end

In the second exitFrame examples Director has to reassign variables each
time it refreshes the frame and therefore (to my mind) it looses speed. I
may be wrong of course, but can i get some guidelines of when do i have to
assign variables and when should i use explicit usage?

TIA
Petro Bochan


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]


Re: lingo-l Minor lingo questions

2004-09-06 Thread Troy Rollins
On Sep 6, 2004, at 9:09 AM, Petro Bochan wrote:
1. About lists. Let's say i've got a bunch of hefty #bitmap members in 
my
cast and i made up my mind to add them all to a linear list to easily
manipulate them. As far as i understand, Lingo manages lists entirely 
in
RAM, so i wonder, will a lingo list duplicate all tose members in 
memory or
just create references to them (in RAM of course) and that way 
manipulate
them?
I suppose there could be two answers to that. Generally it would store 
references. Though in the case of storing something like 
member(bitmap).image, you would be creating and storing a duplicate 
of the current state of the member's image, rather than a reference.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo.  Thanks!]


RE: lingo-l Minor lingo questions

2004-09-06 Thread Petro Bochan
Daniel Plaenitz:

 Evaluating an expression like  sprite someSpriteNum  takes some
 time, too.
 And its much faster to read a script property or variable than to access
 sprite or even member properties. Instead of recreating sprite references
 with every exitFrame you could do it like this:

Thanks Daniel, that helped me alot

--
All the best
Petro Bochan


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]