[bascom] BASCOM51 V2.08 MID() bug
Hi Mark...
I cannot get the MID() function to work correctly, the sample file
STRINGS.BAS works OK so long as you DIM the variables in XRAM. Internal RAM
causes a failure of the function where the variable S in my example below is
chopped off to a LEN() of 2. The simulator shows the problem when watching
the S and Z variables.
This poses a bit of a problem when using the AT89C4051 with no possibility
of using XRAM.
Dim S As String * 50 'dimension string
Dim Z As String * 20 'note that the length
must be specified
S = "This is a test"
Z = "12345"
Mid(s , 1 , 2) = Z 'change part of string
Print S
'12'
is printed instead of the correct value of
'12is a test'
Cheers,
JT.