using_20openin_20_28etc._29_20with_20wildcards
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
using_20openin_20_28etc._29_20with_20wildcards [2018/03/31 11:27] – created richardrussell | using_20openin_20_28etc._29_20with_20wildcards [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Dummy | + | =====Using OPENIN (etc.) with wildcards===== |
+ | |||
+ | //by Richard Russell, June 2010//\\ \\ The BBC BASIC [[http:// | ||
+ | <code bb4w> | ||
+ | file% = OPENIN(" | ||
+ | </ | ||
+ | only files with the extension **ABC** are (initially) displayed for the user to select from.\\ \\ If the user chooses to cancel the operation (by clicking the **Cancel** button in the dialogue box) an **Escape** error is triggered. This happens even if the Escape key has been disabled using ***ESC OFF** (see [[http:// | ||
+ | <code bb4w> | ||
+ | file% = OPENIN(" | ||
+ | filename$ = $$!420 | ||
+ | </ | ||
+ | Assuming **file%** is non-zero, the path and filename of the selected file is placed in the variable **filename$**.\\ \\ //addition by Michael Hutton, edited by Richard Russell, June 2012// | ||
+ | <code bb4w> | ||
+ | file% = OPENIN(file$) | ||
+ | REM Get the file name if was chosen in dialog | ||
+ | IF file$="" | ||
+ | |||
+ | PRINT file$ | ||
+ | |||
+ | END | ||
+ | |||
+ | DEF FN_GetFileNameFromChannel(file%) | ||
+ | MAX_PATH = 260 | ||
+ | LOCAL path%, R% | ||
+ | DIM path% LOCAL MAX_PATH+1 : REM +1 Ensures null termination | ||
+ | SYS " | ||
+ | IF R%=0 THEN ERROR 100, "Error : GetFinalPathNameByHandle" | ||
+ | = $$(path%+4) : REM excludes the leading //?/ | ||
+ | </ |
using_20openin_20_28etc._29_20with_20wildcards.1522495678.txt.gz · Last modified: 2024/01/05 00:16 (external edit)