strange invalid index problem

Peng Du eddy.pdu at gmail.com
Fri Nov 12 18:42:25 CET 2010


Hi there.

My program reads data from a file with 12 columns of hex numbers.

The input part is like:
while(done==0)
  [num_read,
val(1),val(2),val(3),val(4),val(5),val(6),val(7),val(8),val(9),val(10),val(11),val(12)]
= mfscanf(fid, "%x %x %x %x %x %x %x %x %x %x %x %x");
if(num_read>=0) then
...
...
else done=1
end
end
mclose(fid);

Such program has been working fine until today when I tried reading a new
data file with absolutely no difference in format. Scilab keeps reporting
error_21 (invalid index) about one line in the form of "abc = val(1)+val(2)+
... val(12)". But I can't see anything wrong with that. More interestingly,
it worked ok when I limited the program to only read the first, say 100,
lines.

So would anybody kindly point out what I am doing wrong? Thanks very much.

Regards,

Peng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101112/b728c2c0/attachment.htm>


More information about the users mailing list