string read [message #71554] |
Sun, 27 June 2010 22:29 |
gaurijyoti29
Messages: 10 Registered: April 2009
|
Junior Member |
|
|
I am reading the data from a file and passing it to routine dms2d as
given below;
OPENR, unit, 'd:\data.txt'
d=fltarr(8)
dat = ' '
for i=0,3 do begin
READF, unit, dat
print,dat
for j=0,7 do begin
d[j]=dms2d(dat[j])
print,d[j]
endfor
it gives following errors
% Type conversion error: Unable to convert given STRING to DOUBLE
% Detected at : DMS2D
the input file( strarr(8,4) is as follows;
'28 55 31','28 54 23','28 56 27','28 57 18','77 57 10','77 56 52','77
56 42','77 55 23'
'28 54 31','28 55 23','28 57 27','28 54 18','77 59 10','77 58 52','77
56 42','77 55 23'
'28 58 31','28 59 23','28 56 27','28 52 18','77 57 10','77 56 52','77
45 42','77 54 23'
'28 56 31','28 57 23','28 56 27','28 57 18','77 53 10','77 57 52','77
56 42','77 55 23'
would appreciate any help.
|
|
|