Show Globals

Jim Ault JimAultWins at yahoo.com
Wed Dec 10 18:55:26 EST 2008


Hello, again Fred,

Since you said you are using a complex of stacks to run your business, you
are probably in the category of needing to move away from globals and to
something like SQL or Valentina rather than hold all the data in memory.

Custom properties are in RAM when the stack containing them is in memory,
which is why they are so fast.  The same goes for the multi-dimensional
arrays that are new to Rev 3.0+

 The slowness might be that the debugging fields are trying to load the
first 100 chars in a very large number of filled variables and globals.

Why not try something like this for your larger globals?

on mouseup
   set the beginTime of stack "dataCache" to the time
   set the tDate of stack "dataCache" to the date
end mouseup

Here is another version that is a little more compact and useful:
on mouseup
   setValue the time, "beginTime", "dataCache", ""
   put the date into tDate
end mouseup

This might speed things up quite a bit for you without SQL.
To see a working version in a stack, copy the lines below.

------------ start copy -----------------
--paste into a new stack script
--save as "dataCache.rev"
--then double click

on mousedoubleup
  setValue the time, "beginTime", "dataCache", ""  -- a procedure
  get the result;  breakpoint
  --use this for debugging the new value in the IT variable
   
  setValue (the time & space), "sequenceTime", "dataCache", "before"
   -- this is a procedure call
  get the result; breakpoint
  --use this for debugging the new value in the IT variable
   
   
  put the date into tDate --local to this handler
   
  put getValue("beginTime", "dataCache") into it
    -- this is a function call
  breakpoint
end mousedoubleup

------ support handlers  --------------
--put this script into back and it will be available to all handlers
--   in any stack
on setValue val, var, where, place
  if place is empty then
    set the var of stack where to val
  else if place is "before" then
     set the var of stack where to (val & the var of stack where)
  else if place is "after" then
     set the var of stack where to (the var of stack where & val)
  end if
  return the var of stack where
end setValue

function getValue var, where
    return the var of stack where
end getValue
----------  end copy ---------

On 12/10/08 11:54 AM, "Fred moyer" <fmoyer at aol.com> wrote:

>> 
>> Francis Nugent Dixon wrote:
>>> However, I don't know how to show globals assigned
>>> ONLY to the current stack. Does anybody know ?
>> 
> Richard Gaskin wrote:
> 
>> I'm not sure what you mean.  Globals are global in scope, available to
>> any script with a matching global declaration.
> 
> 
> Yes, but why would anyone want to see them when debugging a script
> that doesn't refer to them? For example, if I have a button whose
> script is:
> 
> on mouseup
>     global  gBeginTime
>     put the time into gBeginTime
>     put the date into tDate
> end mouseup
> 
> When debugging this, I want to see the following variable list:
> 
> gBeginTime   11:24 PM
> tDate  11/18/08
> 
> Instead I see a gigantic list of globals that have been called by
> other stacks (I am creating a very complex set of stacks that run my
> business.) Simply scrolling down from gBeginTime and tDate will take
> forever and it's really confusing because you click on the scrollbar
> and nothing happens for over 5 seconds, and you're not sure you
> clicked on the scrollbar, so you click again, and then when it
> finally scrolls, it's gone too far. It is a similar situation when I
> press the scroll arrows or drag the slider. With all of these globals
> listed, there are these long delays.
> 
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list