I know I have posted this before, but I'm asking a different question this time.
I would like to know what I can
really use structs for, as I have no idea what to do.
I understand that they can be used for special functions and whatnot, but I don't know how I would do this.
Basically what I'm asking is, "How do I make a struct actually put something on-screen?"
Like, I could have a struct called WORD*, and I want it to put a word on the screen.
Code:
typedef struct
{
char word[20];
} WORD;
WORD* test_word=
{
word= "Word.";
}
The only way I can think of to put that word on-screen is to use two pre-defined structs, STRING* and TEXT*:
Code:
STRING* show_struct_content= "";
typedef struct
{
char word[20];
} WORD;
WORD* test_word=
{
word= "Word.";
}
TEXT* show_test_word=
{
string= show_struct_content;
flags= VISIBLE;
}
void show_word()
{
str_cpy(show_struct_content,test_word.word);
}
Just add the "#include <acknex.h>" and you have a script that will display the content of struct WORD* on the screen.
Is this the preferred way, or is there something different that I'm not understanding?