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

Home » Public Forums » archive » Re: objects, crashes, and negative memory oh my
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: objects, crashes, and negative memory oh my [message #51638 is a reply to message #51635] Fri, 01 December 2006 11:19 Go to previous messageGo to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Fri, 01 Dec 2006 11:41:08 -0700, Jean H. wrote:

> Pete Warner wrote:
>> Here's a program that crashes me every time. The key part seems to be
>> the "file_search" followed by the "and" statement. Take either out and
>> it doesn't cause me trouble. I'm creating the .txt file because I don't
>> know what to search for on your computers, and file_search needs to
>> find something. I run between 1 and 10 loops before IDL dies on my
>> computer. Tested on 6.1 and 6.3.
>
> even a 1 line
> IDL> a = file_search() & print, 'test ' and a
> makes IDL crash...
> IDL> print, !version
> { x86 Win32 Windows Microsoft Windows 6.3 Mar 23 2006 32 64}
>
> Jean


Ouch. Ok I'll open a bug report and we'll try to fix it for next release.

I've spent a little time looking for a workaround and didn't have much
luck.

About all I can suggest is looking at how the AND operator works on
non-numeric values and maybe changing your code to do the same thing
without using AND.

Docs say:

For operations on other types, the result is equal to the second
operand if the first operand is not equal to zero or the null string;
otherwise, the result is zero or the null string.

So you might replace:

print, 'anystring' and b

with

print, 'anystring' ne '' ? b : ''

Now 'anystring' ne '' doesn't make sense unless 'anystring' is another
variable.

Entire program, with a workaround:

pro testfailure

a = 'test_file.txt'
openw, 1, a
close, 1
free_lun, 1

key = 'b'
any = 'anystring'
count = 0
print, 'Starting Memory: ', memory(/current)
while (key ne 'a') do begin
count++
b = file_search(a)
print, any ne '' ? b : ''
print, 'Memory after iteration ', count, ', ', memory(/current)
print, 'Hit "a" to exit, anykey to continue'
key = get_kbrd(1)
endwhile
print, 'ending'

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: tv with axes routine (colorbar wishlist)
Next Topic: Re: tv with axes routine

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

Current Time: Fri Oct 10 12:38:42 PDT 2025

Total time taken to generate the page: 0.88065 seconds