|
Forum Index : Microcontroller and PC projects : CMM2 - Progress Bar
| Author | Message | ||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
As a spin off from https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=13527 Using SETTICK to make a progress bar works remarkably well: CLS MODE 1 PAGE WRITE 1 DIM RANGE AS INTEGER RANGE = 1000000 'DURATION OF LOOP SETTICK 1000,PBAR(RANGE) SUB PBAR(RANGE) BOX 53,33,(MM-HRES-103)*(X%/RANGE),MM.VRES-556,3,RGB(GREEN),RGB(GREEN) BOX 50,30, MM.HRES-100,MM.VRES-550,3 PAGE COPY 1 TO 2, B END SUB 'DO SOME RANDOM STUFF FOR X% = 1 TO RANGE A%=X% NEXT SETTICK 0,0,1 'STOP TICKER PBAR(X%) ' FINISH OFF BAR TO 100% Entropy is not what it used to be |
||||
| jirsoft Guru Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
You can also use one from my TUI.INC library. So your code will be: MODE 1 PAGE WRITE 1 #INCLUDE "TUI.INC" DIM RANGE AS INTEGER RANGE = 1000000 'DURATION OF LOOP DIM STRING dialog = TUIwaitingON("Progress bar test") 'open dialog TUIwaitingProgress(dialog, 0) 'draw progress bar 0% 'DO SOME RANDOM STUFF FOR X% = 1 TO RANGE A%=X% TUIwaitingProgress(dialog, 100*X%/RANGE) 'update progress bar in % NEXT TUIwaitingOFF(dialog) 'close dialog Edited 2021-02-26 02:39 by jirsoft Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |