Groups | Search | Server Info | Login | Register
Groups > comp.sys.acorn.programmer > #6641
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Steve Fryatt <news@stevefryatt.org.uk> |
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Name of a program |
| Date | Sat, 18 Apr 2026 11:39:26 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 42 |
| Message-ID | <mpro.tdoqxk00q5yfx0cd6.news@stevefryatt.org.uk> (permalink) |
| References | <5cca837cdbbob@sick-of-spam.invalid> <5cca87776fNews04@avisoft.f9.co.uk> <5cca8d05ebbob@sick-of-spam.invalid> |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Date | Sat, 18 Apr 2026 10:55:03 +0000 (UTC) |
| Injection-Info | dont-email.me; posting-host="20c8f34199adff38160c4a5588c1b71c"; logging-data="3323448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UmeZ0E1p8/c4FoDyAYHzK8CNmto5oHLI=" |
| User-Agent | Messenger-Pro/2.73.6.4252 (Qt/5.15.13) (Linux-x86_64) |
| Cancel-Lock | sha1:pCfKQ+dtJp12tPWYWPt4Z3NxuRI= |
| Xref | csiph.com comp.sys.acorn.programmer:6641 |
Show key headers only | View raw
On 16 Apr, Bob Latham wrote in message
<5cca8d05ebbob@sick-of-spam.invalid>:
> If in a Basic assembler file I run SWI OS_GetEnv it just says BASIC, which
> I suppose that is what it is running but it's of no use to me.
>
> I want the name of Basic assembler file.
Isn't it on the tail of the command; something like
BASIC -quit ADFS::0.$.The.Path.To.My.Program
This is how RISC OS runs BASIC programs that you double-click on, or call
via *Filer_Run, or whatever.
From this, you can get the path into a path$ variable as follows:
buffer_size% = 1024
DIM buffer% buffer_size%
REM Read the command line used to call the program.
SYS "OS_GetEnv" TO environment%
SYS "OS_ReadArgs", ",load=quit/K", environment%, buffer%, buffer_size%
SYS "XOS_GenerateError", buffer%!0 TO basic$
SYS "XOS_GenerateError", buffer%!4 TO path$
REM We're assuming that we're being run by a double-click, and so the
REM command line will start "BASIC -quit ...". If not, we don't go
REM any further.
IF basic$ <> "BASIC" OR path$ = "" THEN END
PRINT "My file is ";path$
--
Steve Fryatt - Leeds, England
http://www.stevefryatt.org.uk/
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-16 17:34 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-16 18:17 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-16 19:18 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-16 22:29 +0100
Re: Name of a program Harriet Bazley <harriet@bazleyfamily.co.uk> - 2026-04-17 10:45 +0100
Re: Name of a program Theo <theom+news@chiark.greenend.org.uk> - 2026-04-17 11:43 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-17 12:59 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-17 16:52 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-17 20:15 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-17 23:24 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-18 10:08 +0100
Re: Name of a program Theo <theom+news@chiark.greenend.org.uk> - 2026-04-18 10:56 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-18 11:13 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-18 13:50 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-18 15:29 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-18 16:30 +0100
Re: Name of a program Theo <theom+news@chiark.greenend.org.uk> - 2026-04-18 17:54 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-18 18:06 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-18 18:51 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-18 19:08 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-18 19:36 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-17 12:08 +0100
Re: Name of a program Harriet Bazley <harriet@bazleyfamily.co.uk> - 2026-04-17 14:12 +0100
Re: Name of a program Tank <webmaster@tankstage.co.uk> - 2026-04-17 15:09 +0100
Re: Name of a program Harriet Bazley <harriet@bazleyfamily.co.uk> - 2026-04-17 19:35 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-17 20:17 +0100
Re: Name of a program Martin <News04@avisoft.f9.co.uk> - 2026-04-17 23:30 +0100
Re: Name of a program Steve Fryatt <news@stevefryatt.org.uk> - 2026-04-18 11:39 +0100
Re: Name of a program Bob Latham <bob@sick-of-spam.invalid> - 2026-04-18 13:55 +0100
csiph-web