TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: JIM TANNER
from: BRANDON CARNAHAN
date: 1995-06-11 15:34:00
subject: Example Code...

Quoting JIM TANNER to ALL:
JT>Looking for some PB code that does a "percent bar" such as used by an
JT>installation program to show the percent completed/percent remaining...
Stolen from the DNA Lib set of stuff.
SUB Percentage(Percent%,Row%,Col%,Attr%,TextAttr%)PUBLIC
$CODE SEG "DNASEG2"
FGround% = 15 AND Attr%
BGround% = 255 AND (Attr% - FGround%) / 16
TextFG% = 15 AND TextAttr%
TextBG% = 255 AND (TextAttr% - TextFG%) / 16
IF SCREEN(Row%,Col%)  48 THEN  'check and see if back drop is there
  LOCATE Row%,Col%,0:COLOR TextFG%,TextBG%
  PRINT "0        20        40        60        80      100";
  LOCATE Row% + 1,Col%,0:COLOR FGround%,BGround%:PRINT STRING$(50,32);
ELSE
  IF ISFALSE Percent% THEN  'repaint the screen if 0
    LOCATE Row%,Col%,0:COLOR TextFG%,TextBG%
    PRINT "0        20        40        60        80      100";
    LOCATE Row% + 1,Col%,0:COLOR FGround%,BGround%:PRINT STRING$(50,32);
  END IF
END IF
COLOR FGround%,BGround%
FOR i% = 1 TO Percent%
  IF (i% AND 1) = 1 THEN
    IF SCREEN(Row% + 1,(i% \ 2) + Col%)  219 THEN
      LOCATE Row% + 1,(i% \ 2) + Col%,0:PRINT CHR$(221);
    END IF
  ELSE
    IF SCREEN(Row% + 1,(i% \ 2) + (Col% - 1))  219 THEN
      LOCATE Row% + 1,(i% \ 2) + (Col% - 1),0:PRINT CHR$(219);
    END IF
  END IF
NEXT i%
END SUB
// bc@primenet.com \\
---
 * !CAUTION! Taglines may be hazardous to your disk space!
--- MsgToss 2.0d(beta) 02/21/93
---------------
* Origin: Device and Data Services 786-0219, 786-3964 (1:114/271)

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™.