[Date Prev][Date Next][Subject Prev][Subject Next][Date Index][Subject Index]

Re: QuickNotes



Hi Carl,

No, I haven't previously tried U2's "SmartDir".  I've added the QN version to my user.qnu.  So now if I command 'sd a', all the files with names starting with 'a' appear in the modal, and if I command 'sd ab' in a directory in which I have a file with name starting 'ab', I see all such files.  I interpret the documentation at the top of the routine to say that if I command 'sd ab' in a directory in which the name of no file starts 'ab' then I will see allty directory listing.  Am I misinterpreting the documentation?  I've tried to understand the code.  What does the line 
SET fnm = "$*"
mean?  

After commanding 'sd <something>', sometimes Esc closes the modal, but sometimes it does not.  I haven't been able to determine the conditions="gmail_default" style="font-size:small">
I hadn't tried 'NE <filename.ext>'.  What I'm seeing is that that command creates the file <filename.ext> if no such file exists, and otherwise opens the file.  A minor point is that in the former case the list of files in the Notes pane doesn't update.

Thanks!
Martin

On Sat, May 23, 2026 at 4:19 AM Carl Distefano <dmarc-noreply@xxxxxxxxxxxxx> wrote:
Reply to note from "Martin J. Osborne" <dmarc-noreply@xxxxxxxxxxxxx> Fri, 22 May 2026 22:41:06 -0400

Martin,

> I want to open echocardiogram.txt.

It looks like x<Enter> would be the shortest way there.

Tangentially, I don't know if you've ever tried U2's "SmartDir" command. I use it all the time, and now I've ported it to QuickNotes as SD (see below). So, to take your example, commanding SD e,t would filter the directory entries down to files matching "e*.t*", including your target file. SD 2,s,p would list the 2014 "stress" file. (The last segment of the comma-delimited argument searches for extensions; everything preceding it searches for filenames.)

> But even though it can edit text-like files, I don't think it can
> create a non-md file (can it?).

Oh, sure. NE <filename.ext> creates any type of file you like: txt, html, etc. It's no different from XyWrite or any text editor in that respect. In scripting, WRITEFILE x "file" writes the contents of variable x to the file.

Here's SD. Add it to user.qnu and command RELOADLIB. Be sure to download the latest version of QuickNotes first.

SUB SD
        #DOC: Smart Directory command eases the typing of filespecs
        #DOC: Usage: `SD string1[,[string2],ext`
        #DOC: SD tries DIR `string*.ext*`; if no match,        #DOC: tries `strin*.ext*`, `stri*.ext*`,...`s*.ext*`, `s*.ex*`,
        #DOC: `s*.e*` and, finally, `s*.*`
        # CLD rev. 2026-05-23
        #--------------------
        IF NOT "$1"
                DIR
                EXIT
        EI
        QUIET/NV
        PR
        LOCAL n fnm ext farray spec
        SET fnm = "$*"
        SET ext = "*"
        IF NOT CONTAINS("$fnm", ",")
                SET fnm = "$fnm*"
                GOTO :a
        EI
        SET fnm = REPLACE("$fnm", " ", "")
        SET farray = SPLIT "$fnm" ","
        SET fnm = ""
        SET n = 1
        WHILE $n < $farray[0]
                SET fnm = "$fnm" . "$farray[$n]" . "*"
                SET n = $n + 1
        ENDWHILE
        IF "$farray[$n]" SET ext = "$farray[$n]*"
        :a
        SET spec = "$fnm"
        SET spec = "$spec.$ext"
        CLERR
        DIR $spec
        IF NOT $ERROR
                PR Files matching $spec
                EXIT
        EI
        IF LEN("$ext") > 1
                SET ext = TRIMRIGHT("$ext", 2)
                SET ext = "$ext*"
                GOTO :a
        EI
        IF LEN("$fnm") > 2
                SET fnm = TRIMRIGHT("$fnm", 1)
                IF SUBSTR("$fnm", LEN("$fnm") - 1, 1) != "*" SET fnm = "$fnm*"
                GOTO :a
        ELSE
                PR No matching files
        EI
ENDSUB


Download:
https://ammaze.net/xywwweb/dls/quicknotes.zip

--
Carl Distefano
cld@xxxxxxxxxx




--