Having problems with the modulo operator [message #33090] |
Wed, 04 December 2002 21:47 |
doyle
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
Hi everyone,
I'm having an annoying problem. My program is skipping over a loop
that I have. Specifically it's skipping over the if bit of my code.
I pasted what I have at the bottom of the message. The while runs
just fine but when I get down to the eleventh line of the code it just
keeps on running. What am I doing wrong? I've tried the 0 mod 4 bit
with and without parens.
Thanks in advance
Nate
i=1
new=replicate(data_comp_struct,200)
line=' '
linearr=[' ']
while not EOF(lun) do begin
readf,lun,line
line=strcompress(line)
line=strmid(line,strpos(line,'{ ')+1,strlen(line)-1)
linearr=[linearr,strsplit(line,/extract)]
if linearr[1] eq '{' then linearr=linearr[2:*]
if i eq (0 mod 4) then begin
for j=0,n_elements(linearr)-1 do begin
linearr=linearr[1:*]
exp_time_correct,linearr
data_comp_struct.(j)=linearr[j]
new[i/4]=data_comp_struct
print,new[0]
data_comp_struct=reset
linearr=[' ']
endfor
end
i=i+1
endwhile
|
|
|