Click here to get back home

yaaaq: yet another ArcView/Avenue question

 HomeNewsGroups | Search | About
 comp.infosystems.gis    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
yaaaq: yet another ArcView/Avenue question Sam Jackson 02-11-2005
Get Chitika Premium
Posted by Sam Jackson on February 11, 2005, 10:57 am
Please log in for more thread options
One small thing and I'm hopefully finished:

I want to start a script using DDE. So far the script is contained in my
project and I try to start it using a DDE execute command to ArcView/System
av.run( "myscript","my Parameters")

But somehow ArcView claims 'Unrecognized object: myscript' - do I need to do
something special to start scripts that are in my project? Or do I need to
move the script from my project to be somewhere in ArcView, like an
extension file?


Oh, and how do I access 'my Parameters', is there something like args or %1
in Avenue?

thanks for help!
Sam




Posted by willem van deursen on February 11, 2005, 11:10 am
Please log in for more thread options
The first part I can't help you out. It seems like you are doing the
right think, but calling it with a DDE call seems to complicate this.
DDE is a VERY unstable mechanism (not only within ESRI, but all DDE
technology), and you 'should' try to avoid it as much as possible...

The second question, the parameters, is easier (from the help file under
Run (Request)):
'Finds the Avenue script called aScriptName and executes it.

To find aScriptName, the application searches the current project first,
then the User Default, and finally, the System Default. If it finds no
script named aScriptName, it does nothing.

anObj becomes the object referenced by the SELF keyword in the called
script. ArcView uses anObj to tell the script of the owner object. For
example, SELF is the activating Control for scripts executed on a
control event. The Avenue programmer may use anObj to pass values to the
called script.

For example, execute the script named MyScript and pass it a list.


results = av.Run( "MyScript", { 5, "red", theView } )


MyScript might include something like this...


' get values from argument list
myNum = SELF.Get( 0 )
myString = SELF.Get( 1 )
myDoc = SELF.Get( 2 )


' other statements

' return a result
return "OKAY"
'

Willem

Sam Jackson wrote:
> One small thing and I'm hopefully finished:
>
> I want to start a script using DDE. So far the script is contained in my
> project and I try to start it using a DDE execute command to ArcView/System
> av.run( "myscript","my Parameters")
>
> But somehow ArcView claims 'Unrecognized object: myscript' - do I need to do
> something special to start scripts that are in my project? Or do I need to
> move the script from my project to be somewhere in ArcView, like an
> extension file?
>
>
> Oh, and how do I access 'my Parameters', is there something like args or %1
> in Avenue?
>
> thanks for help!
> Sam
>
>

--
Willem van Deursen, The Netherlands
wvandeursen_nospam@nospam_carthago.nl
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl



Posted by Sam Jackson on February 11, 2005, 12:08 pm
Please log in for more thread options
Hi Willem,

Ah, stupid me, I searched for a lot of stuff in the help, but looking for
av.Run() never occured to me.

Well, now everything runs just fine except calling the script using DDE. I
am not fond of DDE myself either, I just dont see any other way to trigger
the script from outside.

I'll try to find a way to move the script from the project into the ArcView
installation, maybe DDE will work then - I still need to figure out how to
do this, probably got to create an 'extension' for this I think?

Anyway, thanks a lot for the fast help!
Sam


> The first part I can't help you out. It seems like you are doing the right
> think, but calling it with a DDE call seems to complicate this. DDE is a
> VERY unstable mechanism (not only within ESRI, but all DDE technology),
> and you 'should' try to avoid it as much as possible...
>
> The second question, the parameters, is easier (from the help file under
> Run (Request)):
> 'Finds the Avenue script called aScriptName and executes it.
>
> To find aScriptName, the application searches the current project first,
> then the User Default, and finally, the System Default. If it finds no
> script named aScriptName, it does nothing.
>
> anObj becomes the object referenced by the SELF keyword in the called
> script. ArcView uses anObj to tell the script of the owner object. For
> example, SELF is the activating Control for scripts executed on a control
> event. The Avenue programmer may use anObj to pass values to the called
> script.
>
> For example, execute the script named MyScript and pass it a list.
>
>
> results = av.Run( "MyScript", { 5, "red", theView } )
>
>
> MyScript might include something like this...
>
>
> ' get values from argument list
> myNum = SELF.Get( 0 )
> myString = SELF.Get( 1 )
> myDoc = SELF.Get( 2 )
>
>
> ' other statements
>
> ' return a result
> return "OKAY"
> '
>
> Willem
>
> Sam Jackson wrote:
>> One small thing and I'm hopefully finished:
>>
>> I want to start a script using DDE. So far the script is contained in my
>> project and I try to start it using a DDE execute command to
>> ArcView/System
>> av.run( "myscript","my Parameters")
>>
>> But somehow ArcView claims 'Unrecognized object: myscript' - do I need to
>> do something special to start scripts that are in my project? Or do I
>> need to move the script from my project to be somewhere in ArcView, like
>> an extension file?
>>
>>
>> Oh, and how do I access 'my Parameters', is there something like args or
>> %1 in Avenue?
>>
>> thanks for help!
>> Sam
>
> --
> Willem van Deursen, The Netherlands
> wvandeursen_nospam@nospam_carthago.nl
> replace _nospam@nospam_ for @ to get a valid email address
> www.carthago.nl
>




Similar ThreadsPosted
Question about GIS April 12, 2004, 6:21 am
Question about DEM April 7, 2008, 5:32 pm
Newbie question January 27, 2005, 7:37 pm
newbie question. March 20, 2005, 7:15 pm
Question about which hardware to use. August 18, 2005, 8:16 pm
Question on PM1 Quadtree October 13, 2006, 3:43 am
Newbie GIS question October 10, 2007, 1:05 pm
A question about DEM display October 16, 2007, 2:15 am
Coordinate Question February 20, 2008, 3:01 pm
Java question, but GIS related May 3, 2004, 6:10 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap