1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Structure AsciiArr : a.a[0] : EndStructure
Length = 1024
*Buffer.Ascii = AllocateMemory(Length)
*pointer.AsciiArr = *buffer
If *pointer
*pointer\a[0] = 'A'
*pointer\a[1] = 'B'
*pointer\a[2] = 'C'
Debug PeekS(*pointer, -1, #PB_Ascii)
PokeS(*pointer, "Hello World", -1, #PB_Ascii)
For i = 0 To 12
Debug " Dec: " + *pointer\a[i] +
" Hex: " + Hex( *pointer\a[i] ) +
" Chr: " + Chr( *pointer\a[i] )
Next
EndIf
CompilerIf 0
;--------------------------------------------------------------------------------------------------------------
; Data functions ; String functions
;--------------------------------------------------------------------------------------------------------------
; ;
; ;
; Serial Port ;
; ;
WriteSerialPortData(#SerialPort, *Buffer, Length) ; WriteSerialPortString(#SerialPort, String$ [, Format])
ReadSerialPortData (#SerialPort, *Buffer, Length) ;
;--------------------------------------------------------------------------------------------------------------
; ;
; ;
; Process ;
; ;
WriteProgramData(Program, *Buffer, Length) ; PB 5.2x: WriteProgramString (Program, String$) -- optional [, Format] missing (use data functions)
; WriteProgramStringN(Program, String$) -- optional [, Format] missing (use data functions)
; PB 5.3+: WriteProgramString (Program, String$ [, Flags])
; WriteProgramStringN(Program, String$ [, Flags])
;
ReadProgramData (Program, *Buffer, Length) ; PB 5.2x: ReadProgramString(Program) -- optional [, Format] missing (use data functions)
; PB 5.3+: ReadProgramString(Program [, Flags])
;--------------------------------------------------------------------------------------------------------------
; ;
; Network ;
; ;
SendNetworkData (Connection, *Buffer, Length) ; SendNetworkString(Connection, String$ [, Format])
ReceiveNetworkData(Connection, *Buffer, Length) ;
;--------------------------------------------------------------------------------------------------------------
; ;
; File ;
; ;
WriteData(#File, *Buffer, Length) ; WriteString (#File, Text$ [, Format])
; WriteStringN(#File, Text$ [, Format])
ReadData (#File, *Buffer, Length) ; ReadString (#File [, Flags [, Length]])
;--------------------------------------------------------------------------------------------------------------
; ;
; Console ;
; ;
WriteConsoleData(*Buffer, Length) ; Print (Text$) -- optional [, Format] missing (use data functions)
; PrintN(Text$) -- optional [, Format] missing (use data functions)
ReadConsoleData (*Buffer, Length) ; String$ = Input() -- optional [, Format] missing (use data functions)
;--------------------------------------------------------------------------------------------------------------
CompilerEndIf |
Partager