The following code example produces an executable in which the PROC WRTSTR (from 'Terminal.lib') in the PROC PrintText does not print the string A$. At this point during execution the program continuously prints to the screen what looks like the contents of memory.
INCLUDE D:Terminal.lib !-------------------------------------- PROC PrintText (STRING A$[20]) INT I BEGIN FOR I=1 TO 50000 DO NEXT WRTSTR (A$) REPEAT FOREVER END !-------------------------------------- MAIN () STRING A$[20] BEGIN A$ = "Main Proc " WRTSTR (A$) A$ = "PrintText Proc " PrintText (A$) END
If I code the PROC PrintText without a STRING as a parameter I can then execute a WRTSTR without any problems. This example will work whether I have no parameters or if any parameters that are passed are not STRINGs.
INCLUDE D:Terminal.lib !-------------------------------------- PROC PrintText () INT I STRING A$[20] DATA "PrintText Proc "; BEGIN FOR I=1 TO 50000 DO NEXT WRTSTR (A$) REPEAT FOREVER END !-------------------------------------- MAIN () STRING A$[20] BEGIN A$ = "Main Proc " WRTSTR (A$) PrintText () END
Also, WRTSTR will fail in PROC PrintText if I pass a STRING parameter even if I don't use the passed parameter in the WRTSTR statement. This problem persists with the WRTLN function as well, which is just a variant that sends an EOL at the end of the string being printed to the screen. Using PCHAR (and altering the code accordingly) instead of WRTSTR cures the problem, but I'm still wondering why WRTSTR and WRTLN will not function properly in this particular case?
I'm running the compiler off a DOS 2.5 disk rather than the uploaded SpartaDOS disk. I've tried compiling and running it under SpartaDOS X using the original disk and the DOS 2.5 disk as well and it doesn't change the outcome. I've run the executables under emulation and with real hardware and I've compiled it using real hardware. There are no examples of using WRTSTR or WRTLN in the sample game program that Noahsoft included on the PL65 disk. It uses PCHAR for it's title screen.
Normally I would post this in the programming forum, but since the cracked disk was posted on the main forum and since this may be a problem with the cracked compiler or an associated library file, I'm posting it here.
Here are the files for the above example, including a copy of PL65 on a DOS 2.5 disk:
PL65 Example.zip 56.21K
9 downloadsAny help is appreciated.
Thanks,
MF




Send me a message
Find content
Male
Display name history

