MarkDM2
Joined: 19 Dec 2015 Posts: 7 Location: Flanders

|
Posted: Fri Apr 11, 2025 8:55 pm Post subject: Problem with 'Mid' and/or 'Left' functions |
|
|
They don't work like before. I am updating a 5 years old Bascom-Avr program. Is does not work anymore.
I isolated the problem in a testprogram.
The 3 Print-statements should give the same output.
Not anymore now.
Quote: |
Dim Buf(50) As Byte
Dim Bufc As String * 50 At Buf Overlay
Bufc = "$P"
Mid(Bufc,3,2) = "1;"
Mid(Bufc,5,2) = "$T"
Print left(Bufc,6)
Mid(Bufc,1,2) = "$Q"
Mid(Bufc,3,2) = "2;"
Mid(Bufc,5,2) = "$T"
Print left(Bufc,6)
Mid(Bufc,1,6) = "$Q3;$T"
Print left(Bufc,6)
Bufc = "$R4;$T"
Print left(Bufc,6)
|
In the previous version of my program (5 years ago) I used the first compilation of the string. It worked fine, the AVR printed all the 6 character. Now, it prints only 2 chars.
What can be wrong ?
(BASCOM-AVR version : 2.0.8.6 ) |
|