At the risk of showing my ignorance I will try to explain what I am doing.
I have files located in the directory storage/sdcar0/ .
There are 8 folders named engine1....engine8
inside each of these folders are multiple files (23)
that are data files i.e. Bell_on.dat.......SCS.dat....horn_on.dat etc.
These files contain 17 to 23 bytes of data always ending in 4D hex or 77 decimal.
There are event buttons for each of these files assigned to direct the program to a subroutine
called "getcommand" to go find the approriate file and send the 17 to 23 byte data string out through Bluetooth in Rs232(9600,8,NP ,1 SB) to a bluetooth to TTL connection to a model train control computer,
the code for the "getcommand" subroutine is :
[/Code:]
Sub getcommand
raf.initialize(File.DirRootExternal,dirname,False)
count = raf.ReadBytes (arr,0,80,raf.CurrentPosition)
AStreams.Initialize(Null,serial1.OutputStream, "AStreams")
AStreams.Write(arr)
For i = offset To count
Log(arr(i))
If arr(i)= 77 Then
i = count
End If
Next
raf.close
AStreams.close
End Sub]
this program runs correctly and loads the "arr" array and displays them correctly with the log display but when I add the " [ AStreams.Initialize(Null,serial1.OutputStream, "AStreams") ] code it compiles but halts the execution at this line during debug..
What I am attempting is to ; read the file into an array called "arr"
output it in serial format through Astreams.
I know I am misunderstanding something here. Have I loaded the output stream so that it can be sent? Or do I copy "arr" to an inputstream and then copy it to the outputstream?
Im sorry I dont understand your previous comments about using the brackets to display my code.
:sign0013::sign0104::sign0085: