Hi,
I'm a little screwed up with strings and string pointers. I have a function that generates a string, passes it back via a function return, then I need to pass the string to another function for processing. How do I make this work? The function printit below doesn't print.
Anyone around that can help me straighten out the pointers or help with a solution?
thanks a lot,
Dave.
func main()
var temp;
var test[60];
gfx_Set(SCREEN_MODE,PORTRAIT_R) ;
print("Confused about string pointers\n");
temp:= GetErrorText(); //call a function that builds the string
print([STR] temp); //This prints the string
printit(temp); //I want to pass the string to this other function to print it
repeat
forever
endfunc
func printit(var test3)
print([STR] test3); //this does not print the string here, compiler lost the pointer?
endfunc
func GetErrorText()
var ErrorString[60]; //setup string
to (ErrorString); print("How do I make this work?");
return(ErrorString);
endfunc
I'm a little screwed up with strings and string pointers. I have a function that generates a string, passes it back via a function return, then I need to pass the string to another function for processing. How do I make this work? The function printit below doesn't print.
Anyone around that can help me straighten out the pointers or help with a solution?
thanks a lot,
Dave.
func main()
var temp;
var test[60];
gfx_Set(SCREEN_MODE,PORTRAIT_R) ;
print("Confused about string pointers\n");
temp:= GetErrorText(); //call a function that builds the string
print([STR] temp); //This prints the string
printit(temp); //I want to pass the string to this other function to print it
repeat
forever
endfunc
func printit(var test3)
print([STR] test3); //this does not print the string here, compiler lost the pointer?
endfunc
func GetErrorText()
var ErrorString[60]; //setup string
to (ErrorString); print("How do I make this work?");
return(ErrorString);
endfunc
Comment