bobdole369
09-23-2006, 08:08 PM
Writeln() is available from the "console" library. I get the following compiler error when using outside WinMain. I think I'm missing something basic here. WriteLn() works just fine if I do everything in WinMain.
Filename : \my documents\iterate 4.ppl
Parsing...
\my documents\iterate 4.ppl
\Program Files\PPL\Lib\console.ppl
** error ** (\my documents\iterate 4.ppl) Proc or Func "WRITELN" not found at 'WRITELN' (11,1)
** error ** (\my documents\iterate 4.ppl) Proc or Func "WRITELN" not found at 'WRITELN' (13,1)
Total parsing time (411 ms)
Compiling... (3 ms)
Completion time (453 ms)
** 2 error(s), 0 warning(s)
code follows...
#include "console.ppl"
func iterate(j$)
k$=0;
while(k$<j$)
i$=0;
t$=round(tick/1000);
while((round(tick/1000))-t$<=1)
i$=i$+1;
end;
writeln(i$, "cycles");
k$=k$+1;
writeln(k$, "iterations performed");
end;
return(true);
end;
func WinMain
i$ = 0;
initConsole;
showconsole;
iterate(5);
return(true);
end;
Filename : \my documents\iterate 4.ppl
Parsing...
\my documents\iterate 4.ppl
\Program Files\PPL\Lib\console.ppl
** error ** (\my documents\iterate 4.ppl) Proc or Func "WRITELN" not found at 'WRITELN' (11,1)
** error ** (\my documents\iterate 4.ppl) Proc or Func "WRITELN" not found at 'WRITELN' (13,1)
Total parsing time (411 ms)
Compiling... (3 ms)
Completion time (453 ms)
** 2 error(s), 0 warning(s)
code follows...
#include "console.ppl"
func iterate(j$)
k$=0;
while(k$<j$)
i$=0;
t$=round(tick/1000);
while((round(tick/1000))-t$<=1)
i$=i$+1;
end;
writeln(i$, "cycles");
k$=k$+1;
writeln(k$, "iterations performed");
end;
return(true);
end;
func WinMain
i$ = 0;
initConsole;
showconsole;
iterate(5);
return(true);
end;