Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79684] |
Thu, 22 March 2012 18:52  |
Heinz Stege
Messages: 189 Registered: January 2003
|
Senior Member |
|
|
On Thu, 22 Mar 2012 13:30:21 -0700 (PDT), Erini Lambrides wrote:
> Hello all, I am getting this error message when i attempt to .run my
> procedure compare_target_offset2
>
> Compiled module: COMPARE_TARGET_OFFSET2.
> % Compiled module: $MAIN$.
> % DC_WRITE_FREE: Variable is undefined.
>
>
> and the same for DC_WRITE_FIXED, when I try to write my data in a
> variable to a .txt file. These two functions should be in the pv wave
> library - I have version 9.00.
>
> here is how I use it within the code:
>
> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
> \referencetargetdata.txt',rtar)
>
> I apologize now if it's a silly mistake. Thanks!
In PV-Wave DC_WRITE_FREE generates such an error message, when there
is an undefined variable in the parameters. Are you sure, that you
assigned any value to rtar? Can you include the statement "info,rtar"
before calling DC_WRITE_FREE to see if it is defined or undefined?
HTH, Heinz
|
|
|
Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79689 is a reply to message #79684] |
Thu, 22 March 2012 13:38   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
>
> Erini Lambrides writes:
>
>> Hello all, I am getting this error message when i attempt to .run my
>> procedure compare_target_offset2
>>
>> Compiled module: COMPARE_TARGET_OFFSET2.
>> % Compiled module: $MAIN$.
>> % DC_WRITE_FREE: Variable is undefined.
>>
>>
>> and the same for DC_WRITE_FIXED, when I try to write my data in a
>> variable to a .txt file. These two functions should be in the pv wave
>> library - I have version 9.00.
>>
>> here is how I use it within the code:
>>
>> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
>> \referencetargetdata.txt',rtar)
>>
>> I apologize now if it's a silly mistake. Thanks!
>
> I don't know if this is a "silly" mistake, but it
> is certainly not an uncommon one. The directory that
> contains these two functions is simply not on your
> IDL path. (You can print the directories on your
> IDL path to confirm this for yourself.)
>
> I think if you add the directory to your IDL path,
> and restart IDL, you will find that things work
> a LOT better. :-)
Whoops! I meant PV-Wave, of course, not IDL. And,
also, my remarks assume DC_WRITE_FREE and DC_WRITE_FIXED
are functions, as you have called them here, and not
procedures, which would also cause an error message
like this.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79690 is a reply to message #79689] |
Thu, 22 March 2012 13:34   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Erini Lambrides writes:
> Hello all, I am getting this error message when i attempt to .run my
> procedure compare_target_offset2
>
> Compiled module: COMPARE_TARGET_OFFSET2.
> % Compiled module: $MAIN$.
> % DC_WRITE_FREE: Variable is undefined.
>
>
> and the same for DC_WRITE_FIXED, when I try to write my data in a
> variable to a .txt file. These two functions should be in the pv wave
> library - I have version 9.00.
>
> here is how I use it within the code:
>
> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
> \referencetargetdata.txt',rtar)
>
> I apologize now if it's a silly mistake. Thanks!
I don't know if this is a "silly" mistake, but it
is certainly not an uncommon one. The directory that
contains these two functions is simply not on your
IDL path. (You can print the directories on your
IDL path to confirm this for yourself.)
I think if you add the directory to your IDL path,
and restart IDL, you will find that things work
a LOT better. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79713 is a reply to message #79684] |
Tue, 27 March 2012 10:43  |
Erini Lambrides
Messages: 6 Registered: March 2012
|
Junior Member |
|
|
On Mar 22, 9:52 pm, Heinz Stege <public.215....@arcor.de> wrote:
> On Thu, 22 Mar 2012 13:30:21 -0700 (PDT),EriniLambrideswrote:
>> Hello all, I am getting this error message when i attempt to .run my
>> procedure compare_target_offset2
>
>> Compiled module: COMPARE_TARGET_OFFSET2.
>> % Compiled module: $MAIN$.
>> % DC_WRITE_FREE: Variable is undefined.
>
>> and the same for DC_WRITE_FIXED, when I try to write my data in a
>> variable to a .txt file. These two functions should be in the pv wave
>> library - I have version 9.00.
>
>> here is how I use it within the code:
>
>> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
>> \referencetargetdata.txt',rtar)
>
>> I apologize now if it's a silly mistake. Thanks!
>
> In PV-Wave DC_WRITE_FREE generates such an error message, when there
> is an undefined variable in the parameters. Are you sure, that you
> assigned any value to rtar? Can you include the statement "info,rtar"
> before calling DC_WRITE_FREE to see if it is defined or undefined?
>
> HTH, Heinz
Heinz, My mistake was along the lines of what you said, in the end
rtar was undefined. So that problem fixed. Now when I try to format
the file, I get this error message:
% Internal error: Attempt to store into Temp variable with dynamic
allocation..
% Execution halted at COMPARE_TARGET_OFFSET2 <C:\wave_bin\pvpro
\elam_pro/compare_target_offset2.pro( 80)> (DC_WRITE_FREE).
% Called from $MAIN$ .
Right after the loop finishes its first iteration. This is the code:
loop4:
artar=fltarr(nfiles)
axc=fltarr(nfiles)
ayc=fltarr(nfiles)
for i=0, nfiles-1 do begin
spherecenter,aimg(*,*,1),rtar,xc,yc,1,1
artar(i)=rtar
axc(i)=xc
ayc(i)=yc
status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
\referencetargetdata.txt',fnames(i),artar(i),/Column, $
Dt_Template=[1], Format="(A10, 1X, F4.2)")
endfor
fnames(i): String=Array(5)
artar(i):Float=Array(5)
Thanks!
|
|
|