Hello.
I have just started programming on AS.
For example I want to create wrapper subroutines for PRINT instruction to add some additional info to log output:
then I call it from two background programs:
Code
.PROGRAM main.pc ()
WHILE TRUE DO
IF TASK (1002) <> 1 THEN
PCEXECUTE 2:program1.pc
END
IF TASK (1003) <> 1 THEN
PCEXECUTE 3:program2.pc
END
TWAIT 5.0
END
.END
Display More
each program1.pc and program2.pc calls LOG.pc in infinite loops:
Code
.PROGRAM program1.pc ()
WHILE TRUE DO
CALL LOG.pc ("program1")
TWAIT 0.5
END
.END
.PROGRAM program2.pc ()
WHILE TRUE DO
CALL LOG.pc ("program2")
TWAIT 0.5
END
.END
Display More
When I start main.pc I got an error: (P1014) Cannot execute because program already in use. No = 1002.
But why? LOG.pc does not use any global variables