The extend command is a sort of subclassing mechanism. I don't think =
this is what you want.
You can set variables in the global namespace like so:
From: Dennis Bareis [mailto:dbareis@...
Sent: Friday, March 08, 2002 5:10 PM
To: Daniel Leuck; beanshell-users@...
Subject: RE: [Beanshell-users] Variable Scope
On 8 Mar 2002 at 15:23, Daniel Leuck wrote:
> Correction to my last post (I had a little too much coffee)
> The section that currently reads:
> bsh.pat=3Dperson("Pat", "Niemeyer");
> print(bsh.firstName + " " + pat.lastName);
My variables have to be global, I understand that this is not the way=20
a "good" java program would be written.
I don't know the names of the variables that will be created, only=20
the users (indirect) of my beanshell script will know what these are.
Your "bsh" info works well, I juest tried it, I also tried something=20
less global like:
rv =3D object();
and then use Rv but that doesn't, probably "bsh.rv." would. I really=20
would prefer an approach where the user did not have to prefix their=20
variable names, the extend() commands doco uses "namespace" so I've=20
been trying to work out what this does.
Anyway thanks for your answer, it gives me another workable solution.
Dennis Bareis (dbareis@...)
- Contains heaps of my own FREE software (OS/2, Windows, DOS &=20
#include, #import, #if)
Rated 4 stars at ZDNet.
Powerful macros, programmable, import SQL, auto tag examples,=20
Text to HTML, template/style sheet design.
You WILL NOT find an easier to use or more powerful preprocessor=20
Tested on OS/2, Windows, DOS & Linux (probably any Unix OK - if=20
not help me make it so).
* Heaps more...
pages (pages encrypted/scrambled)
- Some source code and programmers links. Regina Information=20
(including porting from OS/2)
* Pure REXX code for CRC16 & CRC32 routines.
- Heaps of COMMENTED OS/2, HTML, Java and other links