[jawsscripts] Re: Include vs use

  • From: Doug Lee <doug.lee@xxxxxxxxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 22 Oct 2019 17:29:59 +0000

There are many factors that go into choosing a structure for a project of 
course. I like to minimize jsb files because I have found a small delay when 
loading many of them on every Alt+Tab into an app, though my testing was long 
ago.

On the other hand, some scripters like to keep a set of utilities to use across 
many projects in a jsb file. This can allow the utilities to be updated and 
immediately apply to all projects (with all the good and bad this
implies :-) ).

On Tue, Oct 22, 2019 at 11:25:21AM -0600, Peter Torpey wrote:
As Doug says, an include statement is like a cut and paste operation and
simply inserts text from the included file at the location where the include
statement is located.

The use statement gives access to the pre-compiled functions and variables
which it references.

As a result the compile time when using the "use" statement" should be much
shorter than if an include statement was used since the include statement
just inserts additional code and has to be compiled each time the source is
compiled.    The "use" method might also lead to a much smaller footprint
for the program if it just acts as pointers to the functions and variables
within the original jss file or can be loaded dynamically when needed rather
than statically.  I don't know how this is treated by the compiler or OS.

--Pete

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On
Behalf Of Sean Farrow
Sent: Monday, October 21, 2019 5:12 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Include vs use

Hi Doug,

Thanks, I've been scripting for a number of years but never knew that!
Are there guidelines as to when to use which construct?
Thanks,
Sean.

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
Sent: 22 October 2019 00:06
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Include vs use

Include loads source in at compile time, as if the included file is part of
the current file. The result all comes out in a single jsb file when
compiled.

Use loads another jsb file at run time, so both jsb files are simultaneously
executing. You don't even have to have jss source for the jsb file you load
with that one.

On Mon, Oct 21, 2019 at 09:20:03PM +0000, Sean Farrow wrote:
CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know the
content is safe.


Hi,
Is there a difference between include vs use.
I'm looking at some scripts and they have some jsl files that are usinghte
include syntax and I feel they should be using the use syntax, but I
wondered what the actually differences are in practice, if any.

Any help appreciated.

Thanks,
Sean.

__________???

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

--
Doug Lee, Lead Accessibility Architect
Level Access - over 1,000 organizations trust us to help them achieve and
maintain digital accessibility compliance!
mailto:Doug.Lee@xxxxxxxxxxxxxxx  http://www.LevelAccess.com "While they were
saying among themselves it cannot be done, it was done." --Helen Keller
__________???

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

__________o?=

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________???

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

-- 
Doug Lee, Lead Accessibility Architect
Level Access - over 1,000 organizations trust us to help them achieve and 
maintain digital accessibility compliance!
mailto:Doug.Lee@xxxxxxxxxxxxxxx  http://www.LevelAccess.com
"While they were saying among themselves it cannot be done, it was done." 
--Helen Keller
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: