I have noticed a difference in the treatment of arrays of structures between version 2.2.1.9 - 1.1.6.3 ICC and the one I have just updated.
Let me explain.
In a form I defined an array of private structures from which I get the individual values contained in other modules via a public function.
The structure consists of a string and a byte.
Initialize the array in the main program and then visualize the different strings on the LCD .. obtained the values obtained contain non-displayable characters.
This thing happens only after the upgrade.
All other strings not in structure are showed correctly on LCD.
Code: Select all
Module FIFO
Structure Utente
Nome As String
Luce As Byte
End Structure
Const _MAX_CALL_POINTS = 16
Private Dim UtStack( _MAX_CALL_POINTS ) As Utente
Private Dim UtLastIN As Byte
Public Inline Sub UtPush(Nome As String, Luce As Integer)
UtStack(UtLastIN).Nome = Nome
UtStack(UtLastIN).Luce = Luce
Inc(UtLastIN)
End Sub
Public Inline Function GetUTLabel(Index As Byte) As String
If Index <= Bound(UtStack) Then
result = UtStack(Index).Nome
Else
result = ""
End If
End Function
Public Inline Function GetUTLight(Index As Byte) As Byte
If Index <= Bound(UtStack) Then
result = UtStack(Index).Luce
Else
result = $FF
End If
End Function
Private Sub Initialize()
UtLastIN = $00
End Sub
Initialize
Code: Select all
....
FIFO.UtPush("1A",1) ' 0
FIFO.UtPush("2A",1) ' 1
FIFO.UtPush("3A",1) ' 2
FIFO.UtPush("1B",2) ' 3
FIFO.UtPush("2B",2) ' 4
FIFO.UtPush("3B",2) ' 5
FIFO.UtPush("1C",3) ' 6
FIFO.UtPush("2C",3) ' 7
FIFO.UtPush("3C",3) ' 8
FIFO.UtPush("1D",4) ' 9
FIFO.UtPush("2D",4) ' 10
FIFO.UtPush("3D",4) ' 11
FIFO.UtPush("1E",5) ' 12
.......
Code: Select all
Module VisStati
Include "graphics.bas"
Include "glcd.bas"
Include "fifo.bas"
dim sUT as String
......
sUT = FIFO.GetUTLabel(2)
If sUT <> "" Then
GLCD.WriteStr(0,0, sUT )
End If
......