I am trying to copy an empty string into another string, because my code is an example.
Thats the reason you get the error message. Give another example, when text_lines isn't empty and you try to copy it into another string.
If you want to check if it's null or not, compare the string to the null ('\0' - that's how it's done in C, maybe it will work with Lite-C too).Edit: comparing it to null won't work, simply compare it to "" if you want to check, if it's empty or not (str_cmp(test_str, "")).
Why would you even need to try to copy empty strings into another one?
Edit2: well, ok... It seems a little weird, take a look at this example:
#define PRAGMA_POINTER
void main()
{
fps_max = 60;
warn_level = 6;
STRING *test_str = "";
TEXT *text_lines = txt_create(1, 0);
//str_cpy((text_lines->pstring)[0], ""); // uncomment this to solve the W1501
while(!key_esc)
{
var res = str_cmp(test_str, (text_lines->pstring)[0]);
DEBUG_VAR(res, 0);
wait(1);
}
}
After txt_create (text_lines->string)[0] should be "" at the start, but it seems that it's not...
Maybe it's something beyond my knowledge, or maybe it's related to acknex itself... So I would set all text strings to "" by hand in a for loop, before doing anything with them, in order to avoid getting W1501 error. This is indeed weird.
int i = 0;
for(i = 0; i < text_lines->strings; i++)
{
if((text_lines->pstring)[i])
{
str_cpy((text_lines->pstring)[i], "");
}
}
Greets.