Any idea why the following produces an error?
printf("this is my text\n");
MyFunc;
function MyFunc
printf("printing from inside function\n");
endfunction
This is the error I get (from the Command Window)
error: 'MyFunc' undefined near line 3, column 3 error: called from function_example at line 3 column 1
Okay, I see the issue now. The function definition needs to be placed before the function call is made - as shown below.
printf("this is my text\n");
function MyFunc
printf("printing from inside function\n");
endfunction
MyFunc;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With