68h TL$XXMD input a filename
Input
A register -  Bit 0 set for multi-line editing, clear for single-line.
Bit 1 set for up/down to exit editor in single-line editing. LZ only.
Bit 7 clear for MODE to exit editor, set if MODE to be ignored.
B register -  Maximum input length.
X register -  Addr of prompt
Output Carry flag - Set if ON/CLEAR pressed.
Description

Typically used to edit a filename, with the MODE key being used to select a pack as in "FIND A:".

TL$XXMD clears the screen, prints a leading byte count string at X followed by a space, a device letter 'A' to 'C' and a colon. The system service ED$EDIT is then called to edit a line of text, typically a file name.

ED$EDIT will edit text in the form of a leading count byte string at RTB_BL. The A and B registers are saved at the start of TL$XXMD and passed to ED$EDIT. The A register will usually be zero, indicating single line editing and that ED$EDIT should exit when the MODE key is pressed. B is the maximum input length.

The device letter is determined by TLB_CPAK. If the MODE key is pressed, the device letter displays the next available pack, and TLB_CPAK is set appropriately.

TL$XXMD returns when either EXE or ON/CLEAR is pressed. If EXE was pressed to exit from TL$XXMD, the carry is returned clear. If ON/CLEAR is pressed, the carry is set, but the B register is undefined. On exit the device selected is held in TLB_CPAK.

Note: TL$XXMD will not work if bit 7 of A is set since this ED$EDIT will not exit when MODE is pressed.

LZ users, see also TL$ZZMD.

Example
    ;   TO INPUT A FILE NAME, STORE IT AS A LEADING COUNT BYTE STRING AT
    ;   FILE_NAME IN THE FORM "D:NNNNNNNN"

        CLR     RTB_BL          ; NO PREVIOUS NAME IN EDITOR WORK AREA
LOOP:   LDX     #PROMPT
        LDD     #8              ; A=0, B=MAX INPUT LENGTH
        OS      TL$XXMD
        BCS     ON_CLEAR_PRESSED

        LDD     #'A:'           ; MAKE INTO THE FORM "A:NNNN"
        ADDA    TLB_CPAK        ; A = TLB_CPAK+'A'
        STD     FILE_NAME+1
        LDAB    RTB_BL          ; GET LENGTH OF EDITED TEXT
        BEQ     LOOP            ; IF ZERO LENGTH, TRY AGAIN

    ;   COPY TO DESTINATION

        CLRA
        STD     UTW_S0          ; NUMBER OF BYTES TO COPY
        ADDB    #2              ; TWO MORE INCLUDING "A:"
        STAB    FILE_NAME       ; STORE NEW LENGTH BYTE
        LDX     #RTT_BF         ; COPY FROM EDITOR WORK AREA
        LDD     #FILE_NAME+3
        OS      UT$CPYB
Errors - none -