EASY - display.newText - displaying multiple text and variable values

Hi there,

Easy question here. How do i get a string of values to work in display.newText.

Example below (not working)


local accountTable{}

accountTable.username = “Bob”

accountTable.welcomeText = display.newText (“welcome” accountTable.username, 50, 50, native.systemFont, 46)

welcomeText.x = display.contentWidth/2

welcomeText.y = display.contentHeight/2


I get the following error message:

‘)’ expected near ‘accountTable’

Thanks :slight_smile:

Daine

If you want to concat strings together, use 2-dots (…)

accountTable.welcomeText = display.newText ("welcome" .. accountTable.username, 50, 50, native.systemFont, 46)

Fantastic, thank you 

All working now :smiley:

If you want to concat strings together, use 2-dots (…)

accountTable.welcomeText = display.newText ("welcome" .. accountTable.username, 50, 50, native.systemFont, 46)

Fantastic, thank you 

All working now :smiley: