Re: ?include? in jscript?

Date : Sun, 3 Feb 2008 16:38:04 -0500
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: ?include? in jscript?
Python uses an "import" statement. There are several ways to use the
import statement, but ultimately it allows you to fetch named objects
(modules, classes, functions, variables, etc), bring them to the
session and use them as objects.

Example:

You have a module named "hello.py". It contains this function:

def sayhello():
    print 'hello'

Now I'm working in XSI, I can do this:

# import hello.py module
import hello

# call its sayhello function
hello.sayhello()



Very powerful.


http://effbot.org/zone/import-confusion.htm


Bernard



On Feb 3, 2008 4:11 PM, Stephen Blair <Stephen_Blair(at)softimage.com> wrote:
>
>
> Yeah, like this you mean?
>
> <script type="text/javascript" src="../../doc/shared/utils.js"></script>
>
> How is the Python way object-oriented?
>
> The html way is pretty much just like #include in C++ or C.
>
>
>
>
>  ________________________________
>  From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of
> Bradley Gabe
> Sent: Sun 03 February 2008 3:52 PM
> To: XSI(at)Softimage.COM
> Subject: Re: ?include? in jscript?
>
>
>
>
> There *is* include in jscript if you are writing for netview.
> However, it must be considered as literally cut and paste of text, it's not
> an object oriented include the way it would be in Python.
>
>
> On Feb 3, 2008 7:42 AM, Stephen Blair <Stephen_Blair(at)softimage.com> wrote:
>
> > Hi Franky
> >
> > There is no such feature in Jscript.
> >
> > Some people use eval. See "The Include() Function" section here:
> > http://digivation.net/programming/registrytools
> >
> > Another approach (used by the SDK Wizards) is to have a custom object
> > that provides features used by all the different wizards.
> >
> > So each wizard calls a command to create an instance of the helper
> > object, and then calls methods on the helper object.
> >
> >
> >
> >
> > // Steve
> > // Team Lead, XSI Customer Support
> > //
> > // See the XSI wiki for KB articles, FAQs, and more...
> > // softimage.wiki.avid.com/Category:Support
> >
> >
> >
> >
> > -----Original Message-----
> > From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
> > Of Frank Lenhard
> > Sent: Sunday, February 03, 2008 8:36 AM
> > To: XSI(at)Softimage.COM
> > Subject: ?include? in jscript?
> >
> > Hi scripters,
> >
> > i dont know if something like i whish for exists in jscript. so far i
> > didnt found any info.
> >
> > what i basically want is writing functions in ONE script and include
> > that script with one nifty line like "include c:\1.jscript" into the
> > current script and have all the functions declared in 1 available in
> > script 2.
> >
> > would keep the scripting much eaasier to read and navigate, then to
> > mess with thousands of lines of code.
> >
> >
> > ciao
> > franky
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> > body:
> > unsubscribe xsi
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> > unsubscribe xsi
> >
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.