finding_20the_20application_20associated_20with_20an_20extension
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
finding_20the_20application_20associated_20with_20an_20extension [2018/03/31 13:19] – external edit 127.0.0.1 | finding_20the_20application_20associated_20with_20an_20extension [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by J.G.Harston, | //by J.G.Harston, | ||
+ | <code bb4w> | ||
DEF FNFile_Association(ext$) | DEF FNFile_Association(ext$) | ||
LOCAL root$, | LOCAL root$, | ||
Line 10: | Line 11: | ||
A%=INSTR(command$,"""""" | A%=INSTR(command$,"""""" | ||
=FNPath_Expand(command$) | =FNPath_Expand(command$) | ||
+ | </ | ||
So, for example, **FNFile_Association(" | So, for example, **FNFile_Association(" | ||
+ | <code bb4w> | ||
DEF FNRegistry_RdInt(hk%, | DEF FNRegistry_RdInt(hk%, | ||
DEF FNRegistry_RdBig(hk%, | DEF FNRegistry_RdBig(hk%, | ||
Line 33: | Line 36: | ||
SYS " | SYS " | ||
=$$B% | =$$B% | ||
+ | </ | ||
\\ | \\ | ||
---- | ---- | ||
//by Richard Russell, September 2008//\\ \\ If you prefer not to access the Registry directly, the function below will return the path and name of the executable program which is associated with a particular file:\\ \\ | //by Richard Russell, September 2008//\\ \\ If you prefer not to access the Registry directly, the function below will return the path and name of the executable program which is associated with a particular file:\\ \\ | ||
+ | <code bb4w> | ||
DEF FN_FindExecutable(file$) | DEF FN_FindExecutable(file$) | ||
LOCAL executable{} | LOCAL executable{} | ||
Line 41: | Line 46: | ||
SYS " | SYS " | ||
= executable.name& | = executable.name& | ||
+ | </ | ||
The main difference from the code listed by Jonathan Harston is that rather than supplying just an extension you must supply the name of an actual file with that extension, which must exist. To overcome that restriction the following function temporarily creates such a file, and in so doing reproduces the functionality of DEFFNFile_Association: | The main difference from the code listed by Jonathan Harston is that rather than supplying just an extension you must supply the name of an actual file with that extension, which must exist. To overcome that restriction the following function temporarily creates such a file, and in so doing reproduces the functionality of DEFFNFile_Association: | ||
+ | <code bb4w> | ||
DEF FNFile_Association(ext$) | DEF FNFile_Association(ext$) | ||
LOCAL executable{} | LOCAL executable{} | ||
Line 49: | Line 56: | ||
OSCLI " | OSCLI " | ||
= executable.name& | = executable.name& | ||
+ | </ | ||
Note that this function relies on the ' | Note that this function relies on the ' | ||
---- | ---- | ||
//by J.G.Harston, | //by J.G.Harston, | ||
+ | <code bb4w> | ||
DEF FNFile_Association(ext$) | DEF FNFile_Association(ext$) | ||
LOCAL executable{} | LOCAL executable{} | ||
Line 59: | Line 68: | ||
OSCLI " | OSCLI " | ||
= executable.name& | = executable.name& | ||
+ | </ |
finding_20the_20application_20associated_20with_20an_20extension.1522502360.txt.gz · Last modified: 2024/01/05 00:17 (external edit)