This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
deletedededed's profile picture

Variables Between Text

Started by deletedededed, 20 November 2014 - 01:05 AM
deletedededed #1
Posted 20 November 2014 - 02:05 AM
I've started work on a simple chat system for my faction in Tekkit. I am trying to set-up a system where you login with any nickname you chose then it enters you to a live chat hosted on a network system (A couple computers in a back room).
Is it possible to enter a name variable between text being printed?

print("Welcome to the chat server!")
print("Please enter your nickname ")
name = read()
print("Connecting "..name" to the chat server")
I'm having errors thrown at me once I add extra quoted text after the ..name variable.

Also I'd love to hear any ideas for how to fluently run the login server for the wireless chat
theoriginalbit #2
Posted 20 November 2014 - 02:11 AM
you were close, .. is the concatenation operator, you've got it on the start, you're just missing it on the end

print("Connecting "..name.." to the chat server")
deletedededed #3
Posted 20 November 2014 - 03:05 AM
Thanks, Hopefully once I finish this I can publish it to the community. I haven't seen any chat programs that have been user friendly.