home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
FCENTER.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
51 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME FCENTER .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
? "┌───────────────────────────────────────────────────────────────────────────
? "│ fCenterPos% ( Mini%, Maxi% , ItemLen% )
? "│ fCenterBox% ( Mini%, BoxLen%, ItemLen% )
? "├───────────────────────────────────────────────────────────────────────────
? "│ There are 2 ways to compute the starting position to print a string, draw
? "│ a box, put an icon, etc. They both return the left/top most column/row but
? "│ work on different information. The one to use, obviously, is the one that
? "│ works with the info you've already got! :)
? "└───────────────────────────────────────────────────────────────────────────
D$ = "This is a test!" '│ something to print
L% = LEN( D$ ) '│ the length
LOCATE 10, 21 : ? "┌"; STRING$(38,"─"); "┐" '│ the "box"
LOCATE 11, 21 : ? "│"; STRING$(38," "); "│" '│ the hard way!
LOCATE 12, 21 : ? "│"; STRING$(38," "); "│" '│
LOCATE 13, 21 : ? "│"; STRING$(38," "); "│" '│
LOCATE 14, 21 : ? "└"; STRING$(38,"─"); "┘" '│
'│
Col% = fCenterPos%( 21, 60, L% ) '│ 21 & 60 are the column #s
LOCATE 11, Col% : PRINT D$ '│
'│
Col% = fCenterBox%( 21, 40, L% ) '│ 21 is the left most col
LOCATE 12, Col% : PRINT D$ '│ 40 is the len of the box
Col% = fCenterPos%( 21, 40, L% ) '│ see the difference?
LOCATE 13, Col% : PRINT D$ '│