hiya guys :cool2:
Along time ago I seen a program & at the end of the program
in qbasic.. it looked like someone was typing & the letters was differant colors.
If I remember right it was FOR & NEXT but it has been along time
& I'm just not getting it lol.
I've looked on tutorials & all & tried finding the file. I havent got my old comp or I would have it saved.
Any ideas of how to do it the best way ?
like type in a simple line & it look like its typing it & changes color
as it goes ?
Thanks for your time & patcience :)
~Bluffyrose~
hey bluffer long time no see
i've never seen that like you're saying. most modern IDE's allow you to do syntax highlighting (coloring)
Code:
DECLARE SUB delay (dlay!)
SCREEN 13
INPUT "Enter Statement"; state$
FOR i = 1 TO LEN(state$)
col = INT((255 - 1 + 1) * RND + 1)
COLOR col
PRINT MID$(state$, i, 1);
delay .5
NEXT
SUB delay (dlay!)
stime! = TIMER
DO
LOOP UNTIL TIMER - stime! > dlay!
END SUB
you mean by this?
this is simple but you can also change colors smoothly with palette command or Out %h3c8,col%...BlahBLah...
got it?
Code:
DECLARE SUB delay (dlay!)
SCREEN 13
INPUT "Enter Statement"; state$
FOR i = 1 TO LEN(state$)
color 10
out &h3c8,10
out &h3c9,r%
out &h3c9,g%
out &h3c9,b%
r% = int((63-1+1)*rnd+1)
g% = int((63-1+1)*rnd+1)
b% = int((63-1+1)*rnd+1)
PRINT MID$(state$, i, 1);
delay .5
NEXT
SUB delay (dlay!)
stime! = TIMER
DO
LOOP UNTIL TIMER - stime! > dlay!
END SUB
or may be this is what u r finding?
[/code]
An interesting output....
i was just meddling with that program...
Code:
DECLARE SUB delay (dlay!)
SCREEN 13
INPUT "Enter Statement"; state$
FOR i = 1 TO LEN(state$)
FOR r% = 1 TO 63 STEP 1
FOR g% = 1 TO 63 STEP 1
FOR b% = 1 TO 63 STEP 1
COLOR 10
OUT &H3C8, 10
OUT &H3C9, r%
OUT &H3C9, g%
OUT &H3C9, b%
NEXT
NEXT
NEXT
PRINT MID$(state$, i, 1);
delay .5
NEXT
SUB delay (dlay!)
stime! = TIMER
DO
LOOP UNTIL TIMER - stime! > dlay!
END SUB
Code:
CLS
PRINT "T"
LOCATE 1, 2
COLOR 4
PRINT "Y"
LOCATE 1, 3
COLOR 7
PRINT "P"
LOCATE 1, 4
COLOR 9
PRINT "E"
END
' Between each letter there needs to be a pause
' As though you was typing
' The program i seen used STEP or TIMER it's been awhile lol
'& im getting older :\ ....any ideas ?
well i don't get what you are trying to ask...
can you tell in detail?
sorry :)
ok
like when you make a program in qb most the time soon as you hit f5 you see all the words there.. just like when you read this post.
you dont see the letters as there being typed .
You see the words & sentences already typed out in full.
What I'm trying to get is a line of code to stop the letters from showing up like this . I want it to look as if the letters are being typed as if someone was typing it while its being read.
another words like a short pause between each letter .
if that makes sence.
Again thank you very much :)
ohhh..
ok
i think it can be done with some sort of hack...
but don't ask me..i don't know.
Have everything you need to be "typed" on screen put into DATA statements. Read back the data into a string array, then display the string arrays, letter by letter with a delay. Some example code:
Code:
dim text$(500) '500 fields for example
total=2 ' how many data statements
for x = 1 to total 'how many text$(x) fields there are in the data statements
read text$(x)
next x
'now we seperate the strings as they get printed
for x = 1 to total
for z = 1 to len(text$(x))
y$ = mid$(text$(x),z,1)
print y$;
sleep 200 '200ms delay
next z
print chr$(13) ' new line between statements
next x
sleep 5000 ' wait 5 seconds before ending
end
data "print what you want here"
data "some more stuff to print"
This could be improved upon greatly, and adding colours is easy enough. Hope this helps you somewhat...
same error again anarky
this is not what he wants....