home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
WORD_R&L.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
63 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME WORD_R&L.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7,0
CLS
? "┌───────────────────────────────────────────────────────────────────────────
? "│ fWordRight% ( MidPos%, V$ )
? "│ fWordLeft% ( MidPos%, V$ )
? "├───────────────────────────────────────────────────────────────────────────
? "│ fWordRight% returns the MID$ position of the word to the right of MidPos%
? "│ fWordLeft% returns the MID$ position of the word to the left of MidPos%
? "│
? "│ BOTH return ZERO if no further words are found
? "│ adjust MidPos% to 1 or LEN(V$) if it is ZERO
? "│
? "│ These routines are really handy in editors!
? "└───────────────────────────────────────────────────────────────────────────
?
A$ = " We are testing fWordRight% "
PRINT CHR$(34); A$; CHR$(34)
DO
M% = fWordRight%( M%, A$ )
IF M% = 0 THEN EXIT LOOP
INCR X%, 1
LOCATE 15, M% +1 : PRINT CHR$(24)
LOCATE 16, M% +1 : PRINT USING "#"; X%
LOOP
M% = 0
X% = 0
A$ = " We are testing fWordLeft% "
PRINT
PRINT CHR$(34); A$; CHR$(34)
DO
M% = fWordLeft%( M%, A$ )
IF M% = 0 THEN EXIT LOOP
INCR X%, 1
LOCATE 19, M% +1 : PRINT CHR$(24)
LOCATE 20, M% +1 : PRINT USING "#"; X%
LOOP