problem while scripting

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Sjizo
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Thu Aug 31, 2006 08:44

problem while scripting

Postby Sjizo » Tue Dec 12, 2006 12:35

Hey all,

Im trying to make some sort of simple console. For now I use an editbox and a static text. The functionality I wanna do in a Lua script, but i ran into a problem. when trying to combine 2 strings like this

Code: Select all

local text = winMgr:getWindow("Root/ConsoleInputLine"):getText()
      local oldText = winMgr:getWindow("Root/ConsoleWindow"):getText()
      winMgr:getWindow("Root/ConsoleInputLine"):setText("")
      local newText = oldText + text

I get this error
[string "../datafiles/lua_scripts/consoleGui.lua"]:11: attempt to perform arithmetic on local 'oldText' (a string value)

What is the correct way of combining 2 strings in Lua?

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Tue Dec 12, 2006 12:48

I recall it was ..

so "this is a string and " .. "this is an another string."

Would equal: "this is a string and this is an another string."

Sjizo
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Thu Aug 31, 2006 08:44

Postby Sjizo » Tue Dec 12, 2006 12:55

Thanks for the quick reply, that was exactly it.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests