This is probably a silly issue -- with some inverted lines of code, or a forgotten "import" or something.
I have a script (it's not the global script).
In the header:
import void AddItem_Safe(ListBox* this, String item);
In the body:
void AddItem_Safe(ListBox* this, String item)
{
this.AddItem(item);
}
void WrapLine(ListBox* lstBox, String desc)
{
String buffer = "";
lstBox.AddItem_Safe(buffer);
}
Then, when I compile :
Error: '.AddItem_Safe' is not a public member of 'ListBox'
(this error is rasied on the line with lstBox.AddItem_Safe(buffer);
I don't get it. What am I missing?
The proper syntax is:
void AddItem_Safe(ListBox this*, String item) (* asteriks at different place)
Quotevoid AddItem_Safe(this ListBox*, String item)
http://www.adventuregamestudio.co.uk/wiki/Extender_functions
What you wrote is a normal function which takes a list box object as first parameter.
The proper syntax is
void AddItem_Safe(this ListBox*, String item)
Also, this is a pure RTFM fail. Just saying.
lol, right. Incorrectly edited the quote.
Yep, pure RTFM. I told you it was silly!
The worse part is that I did read the manual page thouroughly, to check if I was putting the function in the right script, and if the import was OK.
Thanks guys.