Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Martin Newsgroups: comp.sys.acorn.programmer Subject: Re: Name of a program Date: Fri, 17 Apr 2026 16:52:38 +0100 Organization: None Lines: 59 Message-ID: <5ccb038169News04@avisoft.f9.co.uk> References: <5cca837cdbbob@sick-of-spam.invalid> <5cca87776fNews04@avisoft.f9.co.uk> <5cca8d05ebbob@sick-of-spam.invalid> <01ece1ca5c.harriet@bazleyfamily.co.uk> <5ccaee3398bob@sick-of-spam.invalid> Injection-Date: Fri, 17 Apr 2026 15:53:49 +0000 (UTC) Injection-Info: dont-email.me; posting-host="9841f27a00525ddb8f2f2ea4ae6cc908"; logging-data="2704759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HTBR92dp2iW7D7TAQADrF" User-Agent: Pluto/3.21a (RISC OS/5.31) NewsHound/v1.54 Cancel-Lock: sha1:t1JR8+iyEfBAx9sNq3gG+XtQuEA= Xref: csiph.com comp.sys.acorn.programmer:6632 In article <5ccaee3398bob@sick-of-spam.invalid>, Bob Latham wrote: > The nearest I've got is to intercept vector 5 and if you double > click a Basic file it will set the variable and you're good to go. Have you have done an OS_Claim,5 in another program, before double-clicking the program you are wanting to find the name of? Beware that adds an overhead on EVERY command that is issued until the OS_Release,5. And there can be many hundreds of them! > But, if you drop into Basic and then load the basic program then > no-go. That is to be expected... Double-clicking a any file (BASIC, Absolute, Utility, Command, Jpeg, etc) will result in an command: Run This issues another command depending on the hex file type. For a BASIC program this is: @RunType_FFB The Alias$@RunType_FFB for a BASIC program then issues command Basic -quit "" All these three are OS commands, and will pass through the OS_CLI vector 5, and will be seen by anything intercepting that vector at that time. However, when in interactive BASIC, a LOAD filename is a BASIC command, and NOT an OS command, so it is not seen by the OS_CLI vector. The last OS command issued is just BASIC. Issuing a *command or OSCLI("command") would be an OS command. Note that all the OS commands issued can be seen easily if my Reporter is running - see www.avisoft.f9.co.uk > I'm concluding this can't be done. Yes it can, if what you want is the filename of the running program... If the program that is actually running issues an OS_GetEnv SWI you get returned the address of the OS command which started that program. It will include the full , and is exactly the same as passed to OS_CLI and passes through the vector. Therefore... If you have double-clicked a BASIC program it will show Basic -quit If in interactive BASIC it will still just show BASIC after a LOAD. No Claim for OSCLI vector 5 is required. Does that help? -- Martin Avison Note that unfortunately this email address will become invalid without notice if (when) any spam is received.