Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
FFMan wrote:The final line compiles but doesn't return any characters.
I can't reproduce the problem here on either a native mode or a VM device using v3.3.0 of the compiler and v3.3.0 of the ZBasic Library. Here is the test case I used:
Dim s as String
Sub Main()
Dim data(1 to 40) as Byte
Dim i as Integer
For i = 1 to 10
data(i) = CByte(i) + Asc("@")
Next i
Debug.Print "["; foo(data, 10); "]"
s = foo(data, 10)
Debug.Print "["; s; "]"
End Sub
Function foo(ByRef byteArray() as Byte, ByVal cnt as Byte) as String
foo = MakeString(byteArray.DataAddress, cnt)
End Function
If that's not what you see, let me know which version of the compiler you're using and which ZBasic Library version (if you're using a native mode device). If this works properly, perhaps you can modify it to create a test case that exhibits the problem you're seeing.