code for hello + world
I am working with the Ps2 controller object and i need both blocks of data PSX_Data1 and PSX_Data2. I need to join these 2 chunks of data together into one 32 bit binary chunk to send over xbee.
i am new to C, any advice world be greatly appreciated.
in short i need:
long Hello
long World
Pub | Block-0-Data
join "Hello" + "World" into "Block-O-Data"
return
i am new to C, any advice world be greatly appreciated.
in short i need:
long Hello
long World
Pub | Block-0-Data
join "Hello" + "World" into "Block-O-Data"
return

Comments
VAR byte helloBuffer[noparse][[/noparse]20] PUB begin bytemove(@helloBuffer, string("Hello "), 7) 'Put "Hello " into helloBuffer (including the terminating \0 is 7 bytes) strAppend(@helloBuffer, string("World")) 'Append "World" to sring in the helloBuffer 'helloBuffer now contains "Hello World\0" repeat 'forever 'End of story PRI strAppend(strBuffer, strTail) | sizeBuff, sizeTail sizeBuff := strsize(strBuffer) sizeTail := strsize(strTail) bytemove(strBuffer+sizeBuff, strTail, sizeTail)Steve
In your example, willl not the final result be ""Hello \0World\0"?
I'm still learning, so I might be wrong...
JM
to get the termination character from "World\0"
Of course my disclaimer protects me from any errors [noparse]:)[/noparse]