TIP: Click on subject to list as thread! ANSI
echo: qedit
to: DENNIS BROWN
from: RAY ASBURY
date: 1994-12-05 17:15:00
subject: Upper Macro

Hello Dennis,
ÚÄÄÄ>>ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Can someone give an example of a macro that will force the first letter³
³of each word within a block to upper-case, and the remaining chars in  ³
³the word to lower-case?                                                ³
ÀÄÄÄ>>> ALL <<<ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Try this:
    PROC pnSetFirstCharCaps()
        INTEGER liChr,
                liBlkMarked = IsBlockInCurrFile(),
                liMarking   = Set(Marking, OFF),
                liLastLine
        IF (NOT liBlkMarked)
            MarkWord()
        ENDIF
        PushPosition()
        liLastLine = Query(BlockEndLine)
        GotoBlockBegin()
        Lower()
        REPEAT
            IF (IsCursorInBlock())
                liChr = CurrChar()
                CASE (liChr)
                    WHEN _AT_EOL_, _BEYOND_EOL_
                        liChr = 0
                    OTHERWISE
                        InsertText(Upper(Chr(liChr)), _OVERWRITE_)
                ENDCASE
            ENDIF
        UNTIL ( (NOT WordRight()) OR (CurrLine() > liLastLine) )
        PopPosition()
        IF (NOT liBlkMarked)
            UnMarkBlock()
        ELSE
            Set(Marking, liMarking)
        ENDIF
    END pnSetFirstCharCaps
Hope this helps you out!
E. Ray Asbury, Jr. (rasbury@msmailpc01.saic.com)
Team TSE
---
 * SemQWK 1.17 #0 * Flashlight: A case in which to carry dead batteries.
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.