|
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
>
|