Ignore:
Timestamp:
May 8, 2013, 5:56:26 PM (12 years ago)
Author:
Alex Taylor
Message:

Printer Manager: various fixes & updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/shared/PrManUtl.VRS

    r33 r38  
    491491        CALL VRSetIni 'PM_SPOOLER_DD', driver'.'model, driver'.DRV;;;'||'00'x, 'SYSTEM'
    492492    END
     493RETURN ok
     494
     495/*:VRX         DeletePrintDriver
     496*/
     497/* Removes (that is to say, de-registers with the spooler) a PM printer
     498 * device driver/model.
     499 *
     500 *   driver     - The name of the printerpak driver (without path or extension)
     501 *   model      - The printer make/model name used by the driver
     502 *
     503 * Returns: 0 on success, 1 on error
     504 */
     505DeletePrintDriver: PROCEDURE EXPOSE globals.
     506    PARSE ARG driver, model
     507
     508    ok = VRDelIni('PM_SPOOLER_DD', driver'.'model, 'SYSTEM')
    493509RETURN ok
    494510
     
    807823RETURN success
    808824
     825/*:VRX         StringTokenize
     826*/
     827StringTokenize:
     828    PARSE ARG string, separator, __stem
     829    CALL __StringTokenize string, separator, __stem
     830    DROP __stem
     831RETURN
     832
     833/*:VRX         __StringTokenize
     834*/
     835__StringTokenize: PROCEDURE EXPOSE (__stem)
     836    PARSE ARG string, separator, tokens
     837
     838    /* Note: this differs slightly from my usual implementation in that
     839     * each token is STRIPped of leading and trailing spaces.
     840     */
     841
     842    IF ( string = '') THEN RETURN string
     843    IF ( separator = '') THEN separator = ' '
     844
     845    i = 0
     846    CALL VALUE tokens || '0', i
     847    DO WHILE LENGTH( string ) > 0
     848        x = 1
     849        y = POS( separator, string, x )
     850        IF y > 0 THEN DO
     851            current = SUBSTR( string, 1, y-1 )
     852            x = y + 1
     853            i = i + 1
     854            CALL VALUE tokens || 'i', STRIP( current )
     855        END
     856        ELSE DO
     857            current = STRIP( string, 'B', separator )
     858            i = i + 1
     859            CALL VALUE tokens || 'i', STRIP( current )
     860            x = LENGTH( string ) + 1
     861        END
     862        string = SUBSTR( string, x )
     863    END
     864    CALL VALUE tokens || '0', i
     865
     866RETURN
     867
Note: See TracChangeset for help on using the changeset viewer.