I am line :1
I am line 2
I am line :3
I am line 4
I am line :5
I am line 6
I am line :7
I am line 8
I am line :9
I am line 10
_EOF_
wlog "First Loop"
index=1do temp$=file.read$("/Check_SD1.txt",index) if MID$(temp$,len(temp$)-1,1)=":"then
wlog temp$
endif '....the program continues her index=index+1loop until left$(temp$,5)="_EOF_"
wlog
wlog "Second Loop"
index=1do temp$=file.read$("/Check_SD1.txt",index)
if MID$(temp$,len(temp$)-1,1)<>":"then wlog temp$
endif '....the program continues her index=index+1loop until left$(temp$,5)="_EOF_"
wlog
wlog "Third loop"
index = 1
do temp$ = file.read$("/Check_SD1.txt", index)
if MID$(temp$, len(temp$) -1, 1) = ":" then wlog temp$
endif '....the program continues her
index = index + 1loop until left$(temp$, 5) = "_EOF_"
wlog
wlog "Fourth loop"
index = 1
do temp$ = file.read$("/Check_SD1.txt", index) if MID$(temp$, len(temp$)-1, 1) <> ":" then wlog temp$
endif '....the program continues her index = index + 1loop until left$(temp$, 5)="_EOF_"
First Loop
I am line :1
I am line :3
I am line :5
I am line :7
I am line :9
Second Loop
I am line 2
I am line 4
I am line 6
I am line 8
I am line 10
_EOF_
Third loop
I am line :1
I am line :3
I am line :5
I am line :7
I am line :9
Fourth loop
I am line 2
I am line 4
I am line 6
I am line 8
I am line 10
_EOF_
--
You received this message because you are subscribed to the Google Groups "Annex WiFi RDS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rd...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/e691a9ab-e5dc-4d3c-9b0f-82b4b9c9de72o%40googlegroups.com.
Hi Fernando,the issue is related to the nested IF THEN.In your example the problem cannot happen as there is just a DO with a single IF THEN inside.In the Olaf's example, there is an IF with a DO and another IF inside.
if condition1 then
do
if condition2 then
.......
endif
loop until condition3
endif
wlog time$
while 1
t=millis : index=1
if index=1
do
temp$=file.read$("/Check_SD1.txt",index)
if MID$(temp$,len(temp$)-1,1)=":"
wlog temp$
endif
index=index+1
loop until left$(temp$,5)="_EOF_"
endif
wlog "Finish first loop in "; millis-t
wlog
t=millis : index=1
if index=1then
do
temp$=file.read$("/Check_SD1.txt",index)
if MID$(temp$,len(temp$)-1,1)<>":"then
wlog temp$
endif
index=index+1
loop until left$(temp$,5)="_EOF_"
endif
wlog "Finish second loop in "; millis-t
wlog
wend
--
You received this message because you are subscribed to the Google Groups "Annex WiFi RDS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rd...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/70ba0969-67ec-423b-b4a2-44ae97761a91o%40googlegroups.com.
try to put index=0, you should be able to reproduce the problem
The IF can be nested
Example:
IF a=2 THEN IF b = 2 THEN IF c = 3 THEN PRINT "ok" END IF END IF END IF |
The “THEN” keyword can eventually be removed, even if this is not recommended.
Example:
IF a > 100 print "a" else print "b"
There are no problems with nesting loops and IF, just always remember to put a space between the keywords as this may cause problems.
--
You received this message because you are subscribed to the Google Groups "Annex WiFi RDS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rd...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/431a3cd7-967b-4a93-861d-88f641549383o%40googlegroups.com.