M MaxWaterfall Member Licensed User Longtime User Dec 30, 2014 #1 My program won't compile as I'm getting an error with the for loop. B4X: For x = 1 To 15 '15 users mail = m.Body Start = mail.IndexOf(x & ":") + 1 Finish = mail.IndexOf2(CRLF , Start) ''next' expected mail = mail.SubString2(Start,Finish) File.Delete(File.DirDefaultExternal, "UserName" & x & ".txt") File.WriteString(File.DirDefaultExternal, "UserName" & x & ".txt", mail) Next It's expecting a next statement even though there's one at the end. If I comment the line out, the program compiles, no errors.
My program won't compile as I'm getting an error with the for loop. B4X: For x = 1 To 15 '15 users mail = m.Body Start = mail.IndexOf(x & ":") + 1 Finish = mail.IndexOf2(CRLF , Start) ''next' expected mail = mail.SubString2(Start,Finish) File.Delete(File.DirDefaultExternal, "UserName" & x & ".txt") File.WriteString(File.DirDefaultExternal, "UserName" & x & ".txt", mail) Next It's expecting a next statement even though there's one at the end. If I comment the line out, the program compiles, no errors.
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2014 #2 Can you upload your project (File - export as zip)? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2014 #3 You have a both a variable and a sub named Finish which confuses the parser. Upvote 0