RE: ?include? in jscript?
| Date : Mon, 4 Feb 2008 13:06:10 -0600 |
| To : <XSI(at)Softimage.COM> |
| From : "Matt Lind" <mlind(at)carbinestudios.com> |
| Subject : RE: ?include? in jscript? |
With a little preplanning, this is not really an
issue. There won't be namespace issues in JScript if you only put
objects in an 'include' file. The namespace of the object will protect the
object's methods and properties from becoming mangled. If you have other
functions that are called frequently, package them into an XSI command so you
can call it whenever you want and not worry about 'include'
files.
Worst case scenario, you can put a small prefix in front of
all variable names found in the 'include' file to avoid the namespace issue
too. eg: 'lib_name' and 'lib_type' istead of just 'name' and
'type'.
Variable names don't have to be long to accomplish that
feat.
Matt
It's all about name scope.
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Bradley Gabe
Sent: Sunday, February 03, 2008 1:35 PM
To: XSI(at)Softimage.COM
Subject: Re: ?include? in jscript?Let's say in the body of your jscript you name a variable or function "foo", and then there is also a variable or function named "foo" in the file you include. Since jscript is copy/paste of text, your two foos are going to conflict and cause errors. Jscript can't tell the difference between your local foo and imported foo.In Python, when you import a file, all it's variables and functions are imported in the namespace of that file (very much like Model Space in XSI!). So if your file is named "myLib" then it's foo variable or function will be "myLib.foo".So for Jscript, if you intend to do any including, you *must* name all your variables and functions something likely to be unique. It forces annoyingly long variable and function names.On Feb 3, 2008 3:11 PM, Stephen Blair <Stephen_Blair(at)softimage.com> wrote:
Yeah, like this you mean?<script type="text/_javascript_" src=""></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
- Follow-Ups:
- Re: ?include? in jscript?
- From: "Halim Negadi" <hnegadi(at)gmail.com>
- Re: ?include? in jscript?
- References:
- ?include? in jscript?
- From: Frank Lenhard <franky(at)ixdream.com>
- RE: ?include? in jscript?
- From: "Stephen Blair" <Stephen_Blair(at)Softimage.COM>
- Re: ?include? in jscript?
- From: "Bradley Gabe" <withanar(at)gmail.com>
- RE: ?include? in jscript?
- From: "Stephen Blair" <Stephen_Blair(at)Softimage.COM>
- Re: ?include? in jscript?
- From: "Bradley Gabe" <withanar(at)gmail.com>
- ?include? in jscript?
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: Hardware - Graphics card advice
- Next by Date: RE: Hardware - Graphics card advice
- Previous by Thread: RE: Hardware - Graphics card advice
- Next by Thread: RE: Hardware - Graphics card advice
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |