Qbasicnews.com

Full Version: *Click* Loading please wait...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
here is a code on how to make it look like your computer is loading before running a program in QB
Code:
COLOR 9, 0
CLS
LOCATE 11, 35: PRINT "loading..."
LOCATE 12, 34: PRINT "[________________]"
SLEEP 1: LOCATE 12, 34: PRINT "[#_______________]"
SLEEP 1: LOCATE 12, 34: PRINT "[##______________]"
SLEEP 1: LOCATE 12, 34: PRINT "[###_____________]"
SLEEP 1: LOCATE 12, 34: PRINT "[####____________]"
SLEEP 1: LOCATE 12, 34: PRINT "[#####___________]"
SLEEP 1: LOCATE 12, 34: PRINT "[######__________]"
SLEEP 1: LOCATE 12, 34: PRINT "[#######_________]"
SLEEP 1: LOCATE 12, 34: PRINT "[########________]"
SLEEP 1: LOCATE 12, 34: PRINT "[#########_______]"
SLEEP 1: LOCATE 12, 34: PRINT "[##########______]"
SLEEP 1: LOCATE 12, 34: PRINT "[###########_____]"
SLEEP 1: LOCATE 12, 34: PRINT "[############____]"
SLEEP 1: LOCATE 12, 34: PRINT "[#############___]"
SLEEP 1: LOCATE 12, 34: PRINT "[##############__]"
SLEEP 1: LOCATE 12, 34: PRINT "[###############_]"
SLEEP 1: LOCATE 12, 34: PRINT "[################]"
LOCATE 11, 46: PRINT "done"

the problem is that i think it's too slow....is there any way to make it "load" faster?
Man, you're pretty...Big Grin


Use a loop with TIMER for the delay
Code:
COLOR 9, 0
CLS
const delay=0.5   <<'change this constant to suit your needs
LOCATE 11, 35: PRINT "loading..."
c$="______________"
for i=0 to 14
  t!=timer+delay
  do:loop until timer>t!
  LOCATE 12, 34: print c$;
  mid$(c$,i)="#"
next
LOCATE 11, 46: PRINT "done"
Hey Antoni, no offence but you look like Australia's PM John Howard in a way...
thanks antoni...it worked, and now it's much less to write too Big Grin
it didn't work at once thought..had to make some few changes..not much look:
Code:
COLOR 9, 0
CLS
CONST delay = .5   'change this constant to suit your needs
LOCATE 11, 35: PRINT "loading..."
c$ = "[______________]"
FOR i = 2 TO 16
  t! = TIMER + delay
  DO: LOOP UNTIL TIMER > t!
  LOCATE 12, 34: PRINT c$;
  MID$(c$, i) = "#"
NEXT
LOCATE 11, 46: PRINT "done"
Code:
COLOR 9, 0
CLS
a$ = chr$(82)+ chr$(65)+chr$(32)+ chr$(69)+ chr$(83)
b$ = chr$(65) +chr$(66) +chr$(32)+ chr$(82)
c$ = chr$(86)+ chr$(79) +chr$(89)+ chr$(32)+chr$(76) +chr$(76) +chr$(65)
all1$ = a$+b$ +c$
FOR I = 16 TO 1 step -1
  all$ = all$ + mid$(all1$,I,1)
next
LOCATE 11, 35: PRINT "loading..."
LOCATE 12, 34: PRINT "[________________]"
FOR I = 1 to 17
  sleep 400
  locate 12,35:? left(all$,I)
next

LOCATE 11, 46: PRINT "done"
lol...bored Dio?
The simple answer, of course, is don't. If you aren't loading anything, don't make it look like you are.
well, imagine you are actually going to load something in QB..then this could be useful to put in as a "waiting screen" :bounce:

anyway..if u think this looks useless then you don't need to post it do you? neither do you need to post something COMPLETLY useless....unless you are VERY bored ofcourse 8)
Quote:lol...bored Dio?

gotta burn the midnight oil somehow. Smile
Quote:well, imagine you are actually going to load something in QB..then this could be useful to put in as a "waiting screen" :bounce:

anyway..if u think this looks useless then you don't need to post it do you? neither do you need to post something COMPLETLY useless....unless you are VERY bored ofcourse 8)
I remember when I was a total noob too.. I used to make fake loadings all the time.. Then I learned how to code...
You too, will one day learn how to code... Well... maybe you will..
Pages: 1 2