command enableScrollbarIfNeeded pFldName

6 messages Options
Embed this post
Permalink
Jim Sims

command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink
In the dictionary user notes for formattedheight, the word "command"  
is used where "function" might be used.

Can someone please explain the significance of that to me? Is it  
different from a function?

-------
I use the formattedHeight property in a handy routine to turn on/off  
scrollbars as needed. Just call it every time you change the content  
of a field.


command enableScrollbarIfNeeded pFldName
    if the formattedHeight of fld pFldName > the height of fld  
pFldName then
       set the vScrollbar of fld pFldName to true
    else
       set the vScrollbar of fld pFldName to false
    end if
end enableScrollbarIfNeeded
--------


TIA,
sims

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Gaskin

Re: command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink
sims wrote:
> In the dictionary user notes for formattedheight, the word "command"  
> is used where "function" might be used.
>
> Can someone please explain the significance of that to me? Is it  
> different from a function?

Functionally (all puns intended), "command" is synonymous with "on".

"Command" was added to distinguish between message handlers and
commands, though that distinction is stylistic; AFAIK they can be usdd
interchangeably.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Sims

Re: command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink

On Nov 6, 2009, at 6:30 AM, Richard Gaskin wrote:

> sims wrote:
>> In the dictionary user notes for formattedheight, the word  
>> "command"  is used where "function" might be used.
>> Can someone please explain the significance of that to me? Is it  
>> different from a function?
>
> Functionally (all puns intended), "command" is synonymous with "on".
>
> "Command" was added to distinguish between message handlers and  
> commands, though that distinction is stylistic; AFAIK they can be  
> usdd interchangeably.

Thanks... I was wondering if I was missing out on some new script  
goodies there.  ;-)

sims




_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Gaskin

Re: command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jim Sims
sims wrote:

> On Nov 6, 2009, at 6:30 AM, Richard Gaskin wrote:
>
>> sims wrote:
>>> In the dictionary user notes for formattedheight, the word  
>>> "command"  is used where "function" might be used.
>>> Can someone please explain the significance of that to me? Is it  
>>> different from a function?
>>
>> Functionally (all puns intended), "command" is synonymous with "on".
>>
>> "Command" was added to distinguish between message handlers and  
>> commands, though that distinction is stylistic; AFAIK they can be  
>> usdd interchangeably.
>
> Thanks... I was wondering if I was missing out on some new script  
> goodies there.  ;-)

Possibly one:  have you started using the new "private" keyword?

E.g.:

private function EmpName
   return fld "FirstName" && fld "LastName"
end EmpName

By specifying a command or function as "private" means it can only be
accessed by other handers in the same script.

This has two benefits:

1. It helps keep some handlers from being called, things like internal
utility functions in a library stack.

2. Speed:  being available only to the local handler, they trim a fair
bit of the message-passing overhead.  While the time to call both a
private and public handler is too small to be noticeable in a single
call, access time to private handlers benchmark about 30% faster, so for
frequently-accessed handlers it can be useful.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Sims

Re: command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink

On Nov 6, 2009, at 7:11 AM, Richard Gaskin wrote:

>> Thanks... I was wondering if I was missing out on some new script  
>> goodies there.  ;-)
>
> Possibly one:  have you started using the new "private" keyword?

In fact, the Most Excellent & Powerful Sarah  ;-)   has written an  
article about these topics:


http://www.revjournal.com/tutorials/command-and-private.html


Bet you've heard of that web site Richard.


sims

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richard Gaskin

Re: command enableScrollbarIfNeeded pFldName

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jim Sims
sims wrote:

> On Nov 6, 2009, at 7:11 AM, Richard Gaskin wrote:
>
>>> Thanks... I was wondering if I was missing out on some new script  
>>> goodies there.  ;-)
>>
>> Possibly one:  have you started using the new "private" keyword?
>
> In fact, the Most Excellent & Powerful Sarah  ;-)   has written an  
> article about these topics:
>
> http://www.revjournal.com/tutorials/command-and-private.html
>
> Bet you've heard of that web site Richard.

I've seen it once or twice.  ;)

It's good to see someone else has too.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution