Is their a better way to check for wget, either in the !Run obey file or
in the main application file in BASIC to check for wget?
Is their a better way to check for wget, either in the !Run obey file or
in the main application file in BASIC to check for wget?
Kevin Wells <[email protected]> wrote:
Is their a better way to check for wget, either in the !Run obey file orPerhaps something like:
in the main application file in BASIC to check for wget?
SYS "XWimp_StartTask", "wget -V" TO ;flags%
IF (flags% AND 2) THEN ...
On 20/01/2021 20:58, Kevin Wells wrote:
[...]
Is their a better way to check for wget, either in the !Run obey file or
in the main application file in BASIC to check for wget?
[As well as the current method of checking for a system variable]
Off the top of my head, something along the lines of:
IfThere "<Boot$Dir>.Library.wget" then Set <MyApp$WGet>
If "<Wget$Dir>" <> "" THEN Set <MyApp$WGet>
If "<MyApp$Wget>" = "" THEN Error message
Not sure how sensible that is, TBH, having never needed to do something >similar. (And not having a RISC OS machine switched on to check. e.g. is >there a specific variable used for the library directory? Any other
locations it could potentially be squirrelled away in? etc.)
Kevin Wells <[email protected]> wrote:
Is their a better way to check for wget, either in the !Run obey file or
in the main application file in BASIC to check for wget?
Perhaps something like:
SYS "XWimp_StartTask", "wget -V" TO ;flags%
IF (flags% AND 2) THEN ...
I think you have to use Wimp_StartTask because if you use OS_CLI there's a >risk of replacing your BASIC program with the wget application and being >unable to return when it finishes.
This is a check that wget is either somewhere on your Run$Path or an alias >and can successfully execute - if you can run 'wget -V' you know you have a >functioning program, whereas not being in an expected place is only one of >the things that could go wrong.
Theo
I'm implementing in the application BASIC file rather than
the !Run file, in which I use X wget and send the log into the
applications scrap file
Off the top of my head, something along the lines of:
IfThere "<Boot$Dir>.Library.wget" then Set <MyApp$WGet>
If "<Wget$Dir>" <> "" THEN Set <MyApp$WGet>
If "<MyApp$Wget>" = "" THEN Error message
In article <356d64f458.Kevin@Kevsoft>,
Kevin Wells <[email protected]> wrote:
I'm implementing in the application BASIC file rather than
the !Run file, in which I use X wget and send the log into the
applications scrap file
You could always send it to null by redirection.
John
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 34:17:20 |
| Calls: | 12,109 |
| Files: | 15,006 |
| Messages: | 6,518,339 |