Main Page | Report Page

 

  Computers Forum Index » Computer Languages (IDL-PVWAVE) » run .sav file with -args...

Author Message
Truong Le...
Posted: Mon Nov 15, 2010 1:22 am
 
Hi All,

I have created a procedure that I can execute from a window command
line
for example,

idlde sayhello -args param1 param2

when i ran this procedure using the .sav file it didn't work, for
example

idl -vm = sayhello.sav -args param1 param2


It complains that the sayhello.sav function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Thanks!
 
Truong Le...
Posted: Mon Nov 15, 2010 1:42 am
 
On Nov 14, 8:28 pm, David Fanning <n... at (no spam) dfanning.com> wrote:
Quote:
Truong Le writes:
It complains that the sayhello.sav  function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

when I type

idl sayhello.sav -args param1 param2

there is a directory widget the pop-up which allows me to select the
sayhello.sav,
so I am sure the path is correct.
 
David Fanning...
Posted: Mon Nov 15, 2010 6:18 am
 
Truong Le writes:

Quote:
It complains that the sayhello.sav function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
Truong Le...
Posted: Mon Nov 15, 2010 4:53 pm
 
On Nov 14, 8:42 pm, Truong Le <truong... at (no spam) gmail.com> wrote:
Quote:
On Nov 14, 8:28 pm, David Fanning <n... at (no spam) dfanning.com> wrote:



Truong Le writes:
It complains that the sayhello.sav  function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

when I type

idl sayhello.sav -args param1 param2

there is a directory widget the pop-up which allows me to select the
sayhello.sav,
so I am sure the path is correct.

I read other posting and realize that I can't run the .sav file with -
args.
Here is an example what I try to accomplish.

I have a procedure that takes command line arguments as follow:

pro test

; parse the parameters
numArgs = 2
par = COMMAND_LINE_ARGS(COUNT=numArgs)

print, par[0]
print, par[1]
end

when I ran this procedure from the dos command line using idlde by
doing
idlde -args hello hi

and execute the test procedure it print both "hello" and "hi"

I ran the idlde build project and this creates a test.sav file

I need to know how I can execute idl -vm = test.sav from the unix and
passing
in the two arguments that I need. Is this task not possible?

Thanks
 
Paulo Penteado...
Posted: Mon Nov 15, 2010 5:36 pm
 
On Nov 15, 3:27 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:
Quote:
Hi,

I suspect that the spaces you have inserted around "=" might be part of
the issue.

Here's how I run it from command line.

Minke:~ ben$ idl -vm=cmd_args.sav -args hello world

That is just what I was writing. I have used command line arguments
with save files in just that way, with no problems. The pick file
dialog is what IDL shows if one calls it with the -vm argument without
specifying the savefile to use.
 
Truong Le...
Posted: Mon Nov 15, 2010 8:31 pm
 
On Nov 15, 12:27 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:
Quote:
On 11/15/10 11:53 AM, Truong Le wrote:



On Nov 14, 8:42 pm, Truong Le<truong... at (no spam) gmail.com>  wrote:
On Nov 14, 8:28 pm, David Fanning<n... at (no spam) dfanning.com>  wrote:

Truong Le writes:
It complains that the sayhello.sav  function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

when I type

idl sayhello.sav -args param1 param2

there is a directory widget the pop-up which allows me to select the
sayhello.sav,
so I am sure the path is correct.

I read other posting and realize that I can't run the .sav file with -
args.
Here is an example what I try to accomplish.

I have a procedure that takes command line arguments as follow:

pro test

    ; parse the parameters
    numArgs = 2
    par = COMMAND_LINE_ARGS(COUNT=numArgs)

    print, par[0]
    print, par[1]
end

when I ran this procedure from the dos command line using idlde by
doing
idlde -args hello hi

and execute the test procedure it print both "hello" and "hi"

I ran the idlde build project and this creates a test.sav file

I need to know how I can execute idl -vm = test.sav from the unix and
passing
in the two arguments that I need. Is this task not possible?

Thanks

Hi,

I suspect that the spaces you have inserted around "=" might be part of
the issue.

Here's how I run it from command line.

Minke:~ ben$ idl -vm=cmd_args.sav -args hello world
IDL Version 7.1, Mac OS X (darwin x86_64 m64). (c) 2009, ITT Visual
Information Solutions

arg[0] = hello
arg[1] = world

Here's my test routine

PRO cmd_args

    par = COMMAND_LINE_ARGS(COUNT=numArgs)
    IF (numArgs NE 0) THEN BEGIN
       for i = 0, numArgs-1 do $
          print, "arg[" + StrTrim(i,2) + "] = " + par[i]
    ENDIF ELSE BEGIN
       print, "No arguments passed"
    ENDELSE

END

I made the SAV file this way...

IDL> .full_reset
IDL> .comp cmd_args
% Compiled module: CMD_ARGS.
IDL> SAVE, /ROUTINES, filename = "cmd_args.sav"

Cheers,
Ben

It works! thanks Ben
 
Ben Tupper...
Posted: Mon Nov 15, 2010 10:27 pm
 
On 11/15/10 11:53 AM, Truong Le wrote:
Quote:
On Nov 14, 8:42 pm, Truong Le<truong... at (no spam) gmail.com> wrote:
On Nov 14, 8:28 pm, David Fanning<n... at (no spam) dfanning.com> wrote:



Truong Le writes:
It complains that the sayhello.sav function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

when I type

idl sayhello.sav -args param1 param2

there is a directory widget the pop-up which allows me to select the
sayhello.sav,
so I am sure the path is correct.

I read other posting and realize that I can't run the .sav file with -
args.
Here is an example what I try to accomplish.

I have a procedure that takes command line arguments as follow:

pro test

; parse the parameters
numArgs = 2
par = COMMAND_LINE_ARGS(COUNT=numArgs)

print, par[0]
print, par[1]
end

when I ran this procedure from the dos command line using idlde by
doing
idlde -args hello hi

and execute the test procedure it print both "hello" and "hi"

I ran the idlde build project and this creates a test.sav file

I need to know how I can execute idl -vm = test.sav from the unix and
passing
in the two arguments that I need. Is this task not possible?

Thanks

Hi,

I suspect that the spaces you have inserted around "=" might be part of
the issue.


Here's how I run it from command line.

Minke:~ ben$ idl -vm=cmd_args.sav -args hello world
IDL Version 7.1, Mac OS X (darwin x86_64 m64). (c) 2009, ITT Visual
Information Solutions

arg[0] = hello
arg[1] = world


Here's my test routine

PRO cmd_args

par = COMMAND_LINE_ARGS(COUNT=numArgs)
IF (numArgs NE 0) THEN BEGIN
for i = 0, numArgs-1 do $
print, "arg[" + StrTrim(i,2) + "] = " + par[i]
ENDIF ELSE BEGIN
print, "No arguments passed"
ENDELSE

END


I made the SAV file this way...

IDL> .full_reset
IDL> .comp cmd_args
% Compiled module: CMD_ARGS.
IDL> SAVE, /ROUTINES, filename = "cmd_args.sav"





Cheers,
Ben
 
Truong Le...
Posted: Mon Nov 15, 2010 10:42 pm
 
On Nov 15, 3:31 pm, Truong Le <truong... at (no spam) gmail.com> wrote:
Quote:
On Nov 15, 12:27 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:



On 11/15/10 11:53 AM, Truong Le wrote:

On Nov 14, 8:42 pm, Truong Le<truong... at (no spam) gmail.com>  wrote:
On Nov 14, 8:28 pm, David Fanning<n... at (no spam) dfanning.com>  wrote:

Truong Le writes:
It complains that the sayhello.sav  function/procedure is undefined
but the sayhello.sav file does exist. Please let me know if the way I
execute my
procedure using the .sav file is correct.

Have you tried specifying the complete path to the file?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

when I type

idl sayhello.sav -args param1 param2

there is a directory widget the pop-up which allows me to select the
sayhello.sav,
so I am sure the path is correct.

I read other posting and realize that I can't run the .sav file with -
args.
Here is an example what I try to accomplish.

I have a procedure that takes command line arguments as follow:

pro test

    ; parse the parameters
    numArgs = 2
    par = COMMAND_LINE_ARGS(COUNT=numArgs)

    print, par[0]
    print, par[1]
end

when I ran this procedure from the dos command line using idlde by
doing
idlde -args hello hi

and execute the test procedure it print both "hello" and "hi"

I ran the idlde build project and this creates a test.sav file

I need to know how I can execute idl -vm = test.sav from the unix and
passing
in the two arguments that I need. Is this task not possible?

Thanks

Hi,

I suspect that the spaces you have inserted around "=" might be part of
the issue.

Here's how I run it from command line.

Minke:~ ben$ idl -vm=cmd_args.sav -args hello world
IDL Version 7.1, Mac OS X (darwin x86_64 m64). (c) 2009, ITT Visual
Information Solutions

arg[0] = hello
arg[1] = world

Here's my test routine

PRO cmd_args

    par = COMMAND_LINE_ARGS(COUNT=numArgs)
    IF (numArgs NE 0) THEN BEGIN
       for i = 0, numArgs-1 do $
          print, "arg[" + StrTrim(i,2) + "] = " + par[i]
    ENDIF ELSE BEGIN
       print, "No arguments passed"
    ENDELSE

END

I made the SAV file this way...

IDL> .full_reset
IDL> .comp cmd_args
% Compiled module: CMD_ARGS.
IDL> SAVE, /ROUTINES, filename = "cmd_args.sav"

Cheers,
Ben

It works! thanks Ben

what do I need to modify to run the .sav file from the window
environment.
I know that window doesn't run idl but idlde so any help is
appreciated.

Thanks
 
Truong Le...
Posted: Tue Nov 16, 2010 12:16 am
 
On Nov 15, 6:24 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:
Quote:
On 11/15/10 5:42 PM, Truong Le wrote:

On Nov 15, 3:31 pm, Truong Le<truong... at (no spam) gmail.com>  wrote:

what do I need to modify to run the .sav file from the window
environment.
I know that window doesn't run idl but idlde so any help is
appreciated.

Thanks

Hi,

Look at the online docs for "Command Line Options for IDL Startup" (in
IDL 7 help it is buried in "IDL Users' Guides > Using IDL > Introducing
IDL") - scroll to the bottom for Windows specific info regarding this.

Cheers,
Ben

Okay, I ran the above example from the window command line but it
doesn't print the expected
result. It ran through the process that I seen when I ran it under
unix. Under the unix I seen the
words Hello and World printed out but not when I ran under the window
environment. It didn't give
any error message so I am at a lost.

idlrt -vm=cmd_args.sav -args Hello World
 
Truong Le...
Posted: Tue Nov 16, 2010 1:45 am
 
On Nov 15, 7:16 pm, Truong Le <truong... at (no spam) gmail.com> wrote:
Quote:
On Nov 15, 6:24 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:



On 11/15/10 5:42 PM, Truong Le wrote:

On Nov 15, 3:31 pm, Truong Le<truong... at (no spam) gmail.com>  wrote:

what do I need to modify to run the .sav file from the window
environment.
I know that window doesn't run idl but idlde so any help is
appreciated.

Thanks

Hi,

Look at the online docs for "Command Line Options for IDL Startup" (in
IDL 7 help it is buried in "IDL Users' Guides > Using IDL > Introducing
IDL") - scroll to the bottom for Windows specific info regarding this.

Cheers,
Ben

Okay, I ran the above example from the window command line but it
doesn't print the expected
result. It ran through the process that I seen when I ran it under
unix. Under the unix I seen the
words Hello and World printed out but not when I ran under the window
environment. It didn't give
any error message so I am at a lost.

idlrt -vm=cmd_args.sav -args Hello World

okay, I find out that print, var won't work in the virtual machine
under windows. I have to use printf.
 
Truong Le...
Posted: Tue Nov 16, 2010 3:03 am
 
On Nov 15, 8:45 pm, Truong Le <truong... at (no spam) gmail.com> wrote:
Quote:
On Nov 15, 7:16 pm, Truong Le <truong... at (no spam) gmail.com> wrote:



On Nov 15, 6:24 pm, Ben Tupper <ben.bigh... at (no spam) gmail.com> wrote:

On 11/15/10 5:42 PM, Truong Le wrote:

On Nov 15, 3:31 pm, Truong Le<truong... at (no spam) gmail.com>  wrote:

what do I need to modify to run the .sav file from the window
environment.
I know that window doesn't run idl but idlde so any help is
appreciated.

Thanks

Hi,

Look at the online docs for "Command Line Options for IDL Startup" (in
IDL 7 help it is buried in "IDL Users' Guides > Using IDL > Introducing
IDL") - scroll to the bottom for Windows specific info regarding this..

Cheers,
Ben

Okay, I ran the above example from the window command line but it
doesn't print the expected
result. It ran through the process that I seen when I ran it under
unix. Under the unix I seen the
words Hello and World printed out but not when I ran under the window
environment. It didn't give
any error message so I am at a lost.

idlrt -vm=cmd_args.sav -args Hello World

okay, I find out that print, var won't work in the virtual machine
under windows. I have to use printf.

Hi Ben,

I have successfully executed the example above in the window
environment and
so I set out to build a more complicated procedures that I need to
create for
my work. After I build my .sav file from using idlde and ran the .sav
file
using idlrt -vm=filename.sav -args param1 param2 ...

I get the attempt to call undefined procedure/function:'filename'
message.
The .sav file is in the directory. Please let me know what I did
wrong.

Thanks
 
Paulo Penteado...
Posted: Tue Nov 16, 2010 3:09 am
 
On Nov 16, 1:03 am, Truong Le <truong... at (no spam) gmail.com> wrote:
Quote:
I have successfully executed the example above in the window
environment and
so I set out to build a more complicated procedures that I need to
create for
my work. After I build my .sav file from using idlde and ran the .sav
file
using idlrt -vm=filename.sav -args param1 param2 ...

I get the attempt to call undefined procedure/function:'filename'
message.
The .sav file is in the directory. Please let me know what I did
wrong.

Does 'filename.sav' contain a procedure named 'filename'?
 
Truong Le...
Posted: Tue Nov 16, 2010 3:28 am
 
On Nov 15, 10:09 pm, Paulo Penteado <pp.pente... at (no spam) gmail.com> wrote:
Quote:
On Nov 16, 1:03 am, Truong Le <truong... at (no spam) gmail.com> wrote:

I have successfully executed the example above in the window
environment and
so I set out to build a more complicated procedures that I need to
create for
my work. After I build my .sav file from using idlde and ran the .sav
file
using idlrt -vm=filename.sav -args param1 param2 ...

I get the attempt to call undefined procedure/function:'filename'
message.
The .sav file is in the directory. Please let me know what I did
wrong.

Does 'filename.sav' contain a procedure named 'filename'?

no
 
Truong Le...
Posted: Tue Nov 16, 2010 3:31 am
 
On Nov 15, 10:09 pm, Paulo Penteado <pp.pente... at (no spam) gmail.com> wrote:
Quote:
On Nov 16, 1:03 am, Truong Le <truong... at (no spam) gmail.com> wrote:

I have successfully executed the example above in the window
environment and
so I set out to build a more complicated procedures that I need to
create for
my work. After I build my .sav file from using idlde and ran the .sav
file
using idlrt -vm=filename.sav -args param1 param2 ...

I get the attempt to call undefined procedure/function:'filename'
message.
The .sav file is in the directory. Please let me know what I did
wrong.

Does 'filename.sav' contain a procedure named 'filename'?

I thought you can name the .sav file whatever you want to.
 
Truong Le...
Posted: Tue Nov 16, 2010 3:45 am
 
On Nov 15, 10:43 pm, David Fanning <n... at (no spam) dfanning.com> wrote:
Quote:
Truong Le writes:
I thought you can name the .sav file whatever you want to.

Yes, as long as it is the name of the program you are trying
to run. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming:http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

okay, thanks guys! it works!
 
 
Page 1 of 2    Goto page 1, 2  Next
All times are GMT
The time now is Mon Sep 01, 2014 8:56 pm