Posted by Peter Cook 6 on 27/04/2022 13:09:44:
I don't think you can use a wildcard that way in any case. Chain effectively "opens" the file specified, then transfers control to it. If the filename has a wildcard in it, then Chain doesn't know which of the possible matches (Slot1, Slot2, etc.) in the directory to select.
…
PS An alternative would be to always use Slot.exe as the latest version and use Slot-1.exe, Slot-2.exe to provide versioning. That way if you open Slot.exe each time you always get the latest version – but it's a faf.
May be worse than that. TurboBasic is a compiler, making it possible CHAIN is a fixed linkage. If so, the compiler processes the called program beforehand, and the run time code expects to find the same name and binary image when the link is executed.
CHAIN allows the calling and called programs to share COMMON variables. It's a memory management technique, allowing modules to be loaded at run-time only if needed, allowing the programmer to organise programs bigger than the computer can store as an entity. Important on early computers when 640kB was a low ceiling and DOS didn't manage memory well, but unnecessary now computers have gigabytes of memory and operating systems with sophisticated memory management.
If the requirement is to launch a second program, it's possible Greensands' doesn't want CHAIN at all. Try SHELL. TurboBasic's ancient SHELL code might not work on a modern operating system emulating DOS, but if it does SHELL starts a second program with the operating system, and the operating system should understand wildcards.
For lovers of jargon, the technical term for processing wildcards is globbing.
Dave