Hi,
Code: Select all
Structure labelChunkStructure
chunkID.a[4]
chunkSize.l
chunkData.a[0]
p.a
EndStructure
*Buffer = AllocateMemory(100)
PokeS(*Buffer + 0, "TEST", 4, #PB_Ascii|#PB_String_NoZero)
PokeL(*Buffer + 4, 10)
For i = 0 To 9
PokeA(*Buffer + 8 + i, i)
Next i
PokeA(*Buffer + 4 + 4 + 10, 'E')
*Ptr.labelChunkStructure = *Buffer
If PeekS(@*Ptr\chunkID[0], 4 , #PB_Ascii) = "TEST"
For i = 0 To *Ptr\chunkSize - 1
Debug *Ptr\chunkData[i]
Next i
; no direct access to \p
Debug Chr(PeekA(*Ptr + 8 + *Ptr\chunkSize))
EndIf
You have no direct access to \p
And you have to use .a for the ID, because .s reserves 8 Bytes (Unicode) and you can not tell PB tat it is Ascii.
Bernd