by wre <wre.groups@[EMAIL PROTECTED]
>
Aug 29, 2008 at 03:45 AM
On Aug 27, 3:59 am, bu-bu <bedo...@[EMAIL PROTECTED]
> wrote:
> ~ how to make a script resident in memory ?
> i have a script that i want to use every time. I would like to make it
> resident in memory, to avoid to click my buttons many times a day.
If you want to run a script every few seconds you could do this.
hiRegTimer( "yourfunction( \"your input\")" 10)
I use this in a showproperties function which shows the w and l of
the
current selected transistor or resistor for example. I implemented
a value input to start, stop or repeat the function. This enables
you to stop it from repeat mode. Sample code to get the idea:
procedure( wrShowProperties( @[EMAIL PROTECTED]
value instance)
let( ( all internal vars ...)
wrText = nil
unless( boundp( 'wrShowPropertiesValue)
wrShowPropertiesValue = "start"
wrShowPropertiesTextPrev = ""
)
if( null( value) && null( instance)
then
if( wrShowPropertiesValue == "repeat"
then
wrShowPropertiesValue = "stop"
else
wrShowPropertiesValue = "repeat"
)
)
case( wrShowPropertiesValue
( "stop"
wrText = "stopped"
instancepointerPrev = nil
)
( t
....
code to get interesting properties to show
....
if( wrShowPropertiesValue == "repeat" && null( instance)
then
hiRegTimer( "wrShowProperties( \"repeat\")" 10)
)
if( wrShowPropertiesValue == "stop"
then
wrText = "stopped"
)
)
) ;; case
if( wrDecodeBindKeysText == " Alt-q Alt-q"
then
wrTextStop =" (Alt-q to stop)"
else
wrTextStop =" (Alt-q Alt-q to stop)"
)
if( stringp( wrText) && wrText != wrShowPropertiesTextPrev &&
wrWriteModeTxt == wrWriteModeTxtPrev
then
wrWindowName( strcat( wrWriteModeTxt "wrShowProperties: " wrText
wrTextStop))
wrShowPropertiesTextPrev = wrText
)
) ;; let
;; test: wrShowProperties( )
)
see my blog for more details: http://relyveld.wordpress.com/
Greetings, William.