Lua Programming for PSP: Sending a string, then spliting that string

Posted by Trey Andrews on Stack Overflow See other posts from Stack Overflow or by Trey Andrews
Published on 2010-05-06T23:08:29Z Indexed on 2010/05/06 23:18 UTC
Read the original article Hit count: 271

Filed under:
|

How do I send a string between 2 PSPs? Here is a test script:

Script A

Adhoc.init()
Adhoc.connect()

data1 = "Trey777"
data2 = "This is a test!!..."

Outdata = "Name"..data1.."text"..data2

function senddata()
Adhoc.send(Outdata)
end

While true do
screen.waitVblankStart()
screen:flip()
end

Script B

red = Color.new(255,0,0)
Adhoc.init()
Adhoc.connect()

function recevmsg()
data = Adhoc.recv()
----What do I here to split the text?
----print name to line '0,10'
----print text to line'0,20'
end

While true do
screen.waitVblankStart()
screen:flip()
end

Each script will be loaded onto a different PSP. One will send and one will receive. I need to know how does it split a string? string.find and sub return numbers, not text

© Stack Overflow or respective owner

Related posts about psp

Related posts about lua