ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: _Toshy0 on Aug 26, 2021, 02:58 AM

Title: Printing a variable between two strings
Post by: _Toshy0 on Aug 26, 2021, 02:58 AM
im very new to programming in lua and cant figure out how to print a variable between two strings i know it is possible in other languages like python | print("[string1] ,[variable],[string2]") | ive tried similar things and searched the internet for solutions but still no success i have posted an immage below of the code im using for this (there is a closing braket it is just offscreen)
[attach name=Forum+Image.png type=image/png]273[/attach]
Title: Printing a variable between two strings
Post by: Lupus590 on Aug 26, 2021, 04:50 PM
You need to concatenate the strings with the .. operator.

term.write("please enter the"..Message.. "Password: -- whatever else is on that line