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

Home » Public Forums » archive » Re: executing a string in VM without using 'EXECUTE'
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: executing a string in VM without using 'EXECUTE' [message #50637 is a reply to message #50636] Fri, 06 October 2006 02:40 Go to previous messageGo to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
gav wrote:
> There is probably a simple solution to this but I can't find it: I
> want to execute the string below in VM, without using (can't use) the
> 'EXECUTE' command. Any ideas / code etc greatfully received.
>
> com='speci=where('+formula+',speccount) ';write executable
> string
> t=execute(com) ;execute string
>
> the 'formula' is "(mr(*,*,159) le 8 or mr(*,*,170) gt mr(*,*,159)
> or mr(*,*,235) gt mr(*,*,159) )"

extract constants in the array indexing, and the limits with the
strmid/stregex functions. Turn them into variables, and build the
equation that way. Something like this:

b = stregex(formula,
'([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9] +([0-9]+)[^0-9]+([0-9]+)',
/extract, /sub)
speci=where(mr[*,*,long(b[1])] le long(b[2]) or mr[*,*,long(b[3])] gt
mr[*,*,long(b[4])] or mr[*,*,long(b[5])] gt mr[*,*,long(b[6])],
speccount)

That is , assuming the structure of the formula remains the same, only
the values change. If you want something more general, you have to
explain where teh string comes from.

Maarten
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: executing a string in VM without using 'EXECUTE'
Next Topic: Re: wrapper functions

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

Current Time: Wed Oct 08 19:29:13 PDT 2025

Total time taken to generate the page: 0.00444 seconds