|
Post by xstreur on Oct 6, 2014 20:38:05 GMT 1
Hello, when trying to compile the following code:
FUNCTION HostName1$ LOCAL Temp$ TYPE STRING Temp$ = EXEC$("hostname") RETURN Temp$ END FUNCTION
A$=HostName1 PRINT A$
I get this message:
$ bacon -c gcc test.bac WARNING: 7 temporary files found! Do you want to delete them (y/n)? y Temporary files were deleted. Converting 'test.bac'... done, 13 lines were processed in 0.004 seconds. Compiling 'test.bac'... gcc -c test.bac.c Compiler error: Runtime error: statement 'OPEN FOR READING' at line 7191 in 'bacon.bac': Error opening file: No such file or directory
Linux: CentOS 7 (64 bits) BaCon version 3.0.1 - (c) Peter van Eerten - GPL v3.
|
|
|
Post by vovchik on Oct 6, 2014 21:03:01 GMT 1
Dear xstreur,
Not a real bug, I think. First you need the $ after HostName1, and the round brackets when you make the assignment:
FUNCTION HostName1$() LOCAL Temp$ TYPE STRING Temp$ = EXEC$("hostname") RETURN Temp$ END FUNCTION A$=HostName1$() PRINT A$
With kind regards, vovchik
|
|