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

Home » Public Forums » archive » assigning integer and string value to same variable one by one
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
assigning integer and string value to same variable one by one [message #93009] Sat, 09 April 2016 04:26 Go to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Pro tt

for i=0,25 do begin
Print,'By seeing mplot give obj_col:'
Read,obj_col
wait,1

if (STRMATCH(datatype(obj_col), 'INT', /FOLD_CASE) EQ 0) then i=i+1
print,i
endfor
return
end

IDL> .compile tt.pro
% Compiled module: TT.
IDL> tt
By seeing mplot give obj_col:
: 1
% Compiled module: DATATYPE.
0
By seeing mplot give obj_col:
: 'q'
% READ: Input conversion error. Unit: 0, File: <stdin>
% Execution halted at: TT 5 /home/cs/dN_dz/Ana/tt.pro
% $MAIN$
IDL>


Can't I give integer and string value to same variable if I want to jump on loop if the value of that input variable in a string??
Any way out?
Re: assigning integer and string value to same variable one by one [message #93010 is a reply to message #93009] Sat, 09 April 2016 04:27 Go to previous message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Pro tt

for i=0,25 do begin
Print,'By seeing mplot give obj_col:'
Read,obj_col
wait,1

if (STRMATCH(datatype(obj_col), 'STR', /FOLD_CASE) EQ 1) then i=i+1
print,i
endfor
return
end

IDL> .compile tt.pro
% Compiled module: TT.
IDL> tt
By seeing mplot give obj_col:
: 1
% Compiled module: DATATYPE.
0
By seeing mplot give obj_col:
: 'q'
% READ: Input conversion error. Unit: 0, File: <stdin>
% Execution halted at: TT 5 /home/cs/dN_dz/Ana/tt.pro
% $MAIN$
IDL>


Can't I give integer and string value to same variable if I want to jump on loop if the value of that input variable in a string??
Any way out?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fill_plot
Next Topic: assigning integer and string value to same variable one by one

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

Current Time: Wed Oct 08 11:36:09 PDT 2025

Total time taken to generate the page: 0.00457 seconds