Joined: 11 Dec 2007 Posts: 112 Location: rio de janeiro
Posted: Sat Jan 31, 2015 2:47 pm Post subject: strange problem with loop for-next
Hello all!
I was trying to run an old program to dump eeprom contents and found a strange result.
I was able to dump only the first line , and after some inspection I noticed that the loop for-next is not working , or I am not seeing the real problem.
Bellow I provide a code fragment and please note that I replaced eeprom instructions for dummy byte only for checking purposes. I can see that thereīs neither bufferout overflow nor Contagem2 loop performing..
When run in simulator you see only the first line printed...
Using last version 2.0.7.8
Dim Strtime As String * 9
Dim Bufferout As String * 120
Dim Contagem1 As Word
Dim Contagem2 As Word
Dim D As Byte
Dim Mes As Byte
'---------- DUMP ------------------------
For Contagem2 = 0 To 32767 Step 16
Bufferout = ""
Strtime = "0000" + Hex(contagem2 )
Strtime = Right(strtime , 4)
Bufferout = Strtime + " "
For D = 0 To 15
Contagem1 = Contagem2 + D
'Readeeprom Mes , Contagem1
Mes = 49
Bufferout = Bufferout + Hex(mes) + " "
Next
Bufferout = Bufferout + "| "
For D = 0 To 15
Contagem1 = Contagem2 + D
'Readeeprom Mes , Contagem1
Mes = 49
If Mes < 32 Then
Mes = 32
End If
Bufferout = Bufferout + Chr(mes)
Next
Print Bufferout
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum