comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: An expression calculator?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: An expression calculator? [message #36204] Mon, 11 August 2003 18:19
Weimin Wang is currently offline  Weimin Wang
Messages: 7
Registered: October 2002
Junior Member
I got it.The execute function may complete my task.:)

Weimin Wang 写锟斤拷锟斤拷
>
> Hi,all
>
> Now i have a simple program written.However,I encounter a problem.A
> mathematical expression stored as string variable is inputed to my
> procedure.I want to calculate its value with after parameter are
> known.Does someone have an experience finishing such a mission?
>
> Many thanks in advance.
>


--
Best Regards,

Wang Weimin

WaterCenter,Institute of Geo.
Sci. & Nature Resource Research,
Chinese Academy of Science,
Beijing,100101,China
Tel:86-10-64889762-5

http://qtirsl.igsnrr.ac.cn
Re: An expression calculator? [message #36214 is a reply to message #36204] Mon, 11 August 2003 09:16 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Weimin Wang wrote:

> Hi,all
>
> Now i have a simple program written.However,I encounter a problem.A
> mathematical expression stored as string variable is inputed to my
> procedure.I want to calculate its value with after parameter are
> known.Does someone have an experience finishing such a mission?
>
> Many thanks in advance.
>

Dear Weimin

there are several solution possible,

The oldest one ist to use execute. But then the routine won't run by vm or
rt.


a=6
b=7

x=execute('result=a+b')
print,result
13

One other posibility is to write a routine like icgs_calc.

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/icgs_calc_dbase.pro.html


One other is to write the string to a function, declare the input variables
for the function and then call the function by call function.


regards
Reimar




--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 6.0 download available!
Next Topic: creating shape-files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 20:26:48 PDT 2025

Total time taken to generate the page: 8.64155 seconds