Having a dumb moment - trying to add a text string to a text message

Cant quite work out how to enter a string into a text message

My function is:

[lua]function newSMS()
native.showPopup(“sms”, {
body = “Stuff and Things”
})
end[/lua]

The above works fine, but I want to have a variable in the body instead of the pre-defined text.

I’ve tried the below and cant get it working, think I have the syntax wrong.

[lua]function newSMS()
native.showPopup(“sms”, {
body = variable1 … variable2
})
end[/lua]

[lua]function newSMS()
native.showPopup(“sms”, {
body = variable1 + variable2
})
end[/lua] [import]uid: 62706 topic_id: 29942 reply_id: 329942[/import]

What about:

[lua]function newSMS()
native.showPopup(“sms”, {
body = variable1.text … variable2.text – or perhaps (variable1.text, variable2.text)
})
end[/lua]
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 29942 reply_id: 120088[/import]

Thanks, its fixed now!

Decided to pull straight from my tables instead.

[lua]body = (questionString[r] … answerString[r]) – r is a random number[/lua] [import]uid: 62706 topic_id: 29942 reply_id: 120094[/import]

You`re welcome!

Glad to help anyway. :slight_smile:
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 29942 reply_id: 120137[/import]

What about:

[lua]function newSMS()
native.showPopup(“sms”, {
body = variable1.text … variable2.text – or perhaps (variable1.text, variable2.text)
})
end[/lua]
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 29942 reply_id: 120088[/import]

Thanks, its fixed now!

Decided to pull straight from my tables instead.

[lua]body = (questionString[r] … answerString[r]) – r is a random number[/lua] [import]uid: 62706 topic_id: 29942 reply_id: 120094[/import]

You`re welcome!

Glad to help anyway. :slight_smile:
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 29942 reply_id: 120137[/import]