Hi Everybody
I have a strange issue with Joinbytes.
I'm preparing records to write on a SD file. I use joinbytes to setup the row(it's a text file).
The code is:
The print sub is
The log is:
Appstart repeats after tmp2 log, so I can think the
has reset the micro. To void power shortage I have used a V12 A2 power supply, but Issue goes on.
Tmp is built on a byte array(infact a string, tmp2) and three int's(day, month, year)
Any idea?
Thank you for support
Mauro Zanin
I have a strange issue with Joinbytes.
I'm preparing records to write on a SD file. I use joinbytes to setup the row(it's a text file).
The code is:
B4X:
Dim tmp() As Byte
Main.sd.OpenReadWrite(nome)
Main.Sd.Position = Main.Sd.CurrentFile.Size
If inreportr=False Then 'Scrive intestazione
inreportr = True
print ( "COEL METALREMOTE")
Dim tmp2() As Byte=leggilabel("report", "DR4")
Log("tmp2:",tmp2," ",Main.d," ",Main.m," ",Main.y)
tmp=JoinBytes(Array(tmp2 , " ",Main.d,"-",Main.m,"-",Main.y))
Log(tmp)
print (tmp ) ' Report degli errori
tmp=JoinBytes( Array("METAL DETECTOR : " , Nomemet))
print (tmp)
print ( "--------------------------------------------")
End If
B4X:
Sub print (dato() As Byte)
Log(dato," Lungo:",dato.length)
Main.sd.Stream.WriteBytes(dato,0,dato.Length)
Main.sd.Stream.WriteBytes(Array As Byte(13,10),0,2)
Log(dato)
End Sub
B4X:
AppStart
SD init
18Anno:2018
Logouterroridate1
18Anno:2018
Logouterroridate2:2
/logmetal/segnala/METAL1/_2_7.txt
COEL METALREMOTE Lungo:16
COEL METALREMOTE
Search for:DR4=
Findstring:DR4=
Findstring11110123456789101112131415161718192021222324252627282930DR4=SEGNALAZIONE ERRORI
statica.stringa:DR4=SEGNALAZIONE ERRORI
tmp2:DR4=SEGNALAZIONE ERRORI 7 2 2018
AppStart
Appstart repeats after tmp2 log, so I can think the
B4X:
tmp=JoinBytes(Array(tmp2 , " ",Main.d,"-",Main.m,"-",Main.y))
Tmp is built on a byte array(infact a string, tmp2) and three int's(day, month, year)
Any idea?
Thank you for support
Mauro Zanin
Last edited: