I have added this script to my game & it tells me that the strcopy is a mismatch non-variable/variable
string input;
GetTextBoxText(0,1,input);
StrCopy(labeltext,StrCat(input,labeltext));
SetLabelText(0,0,labeltext);
As always I have probably neglected to read something buried in the help file
I'm not good with this kind of scripts but I think you need to add
string labeltext;
in the top of the script.
That'd work, if StrCat actually returned a string variable, but it doesn't (iirc), it operates on the strings you pass to it and returns nothing, I guess they are passed by reference rather than value. Ã, I think what you'd want to do is this:
string input;
GetTextBoxText(0,1,input);
StrCat(input,labeltext)
StrCopy(labeltext, input);
SetLabelText(0,0,labeltext);
or similar, although I'm not sure exactly it is what you want to happen.
Thanks, I kind of knew that, but I wondered why my way wouldn't work.
And the input has to be used again with the same value so it was even longer
By the way labeltext is a global string so I didn't declare it here.
Quote from: AnInhumer on Wed 08/06/2005 16:19:05
Thanks, I kind of knew that, but I wondered why my way wouldn't work.
Because as Scotch pointed out, AGS functions cannot return a string.
So stuff like:
StrCat(input,labeltext)actually won't return a string (that's why it won't work as a
string parameter in StrCopy() ), but it'll directly save the concatenated string into the supplied parameter input.