Does anyone know an embedded Visual Basic command I can use to make the PPC wait without bringing up that stupid round logo? I want to do a type of animation using a picture box, and I need the PPC to wait a half second or so before displaying the next image.
It seems like sleep() should work, but I'm having problems getting it to work. Any advice?
sleep doesnt work ? ... hmm...
it works fine in eVC++ ..
Have you tried just a timeout routine? something like
this:
Sub Timeout(duration)
On Error Resume Next
StartTime = Timer
Do While Timer - StartTime < duration
'do nothing....
'in standard VB, I put a "doevents" in here...
Loop
End Sub
Note, this is my code from standard visual basic
I have not tried it in Embedded yet.... use
at your own risk... and dont time out too long..
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
My recent reviews:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Put the image stepping code (no time regulation) in a timer element and set the interval of the element to 1000.
ex. code inside timer, image(i)= string array with content of location of each frame:
For I = 1 to 10 'ten frames
Picture1.picture=image(i)
Next I
From then on with the with the interval set to 1000 (interval is the delay in milliseconds), 10 pictures will be loaded, one every second.
I've used a timer element to control the ball in a Break Out clone I was working on in eVB. It is annoying that eVB isn't as fully featured as desktop VB, it doesn't support elements as arrays, which means I need huge if then lists, instead of single if then inside a for next to figure out if a brick has been hit. :(
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Well, I ended up doing something similar. I'm animating opening and closing a menu. The images are called menu0.bmp, menu1.bmp... menu4.bmp. I set a variable to -1, and have a timer event run every half second. If I want the image to go from menu0 - menu4, I set the variable=0, and the timer event takes over, incrementing the variable by 1 and displaying the new picture until the variable=5. To start it in reverse, I just set the variable=4.
__________________
Lawson Culver
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
A cleaner way is to leave the interval of the element set to 0 at startup, then whatever event you'd normally set that variable to 0, have that set timer1.interval=500, and then at the point you'd reset the variable=-1 set it to 0 instead and after that set timer1.interval=0.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
On a related note... Man I feel like such a newbie.. I'm trying to use the timer control.l
From in the app there it looks like this:
x does not = y
do while x = y
'do stuff here..
timer1.interval = 5000
timer1.enabled = true
call timer1_timer
private sub timer1_timer()
'more stuff goes on in here.
'this stuff actually DOES get executed, but there is no "pausing"
End Sub
From what I understand (which is clearly wrong) the timer loop should execute, wait for the timer interval and then execute again. But it just FLIES right through..
Any idea what I'm doing wrong?
__________________
Always read stuff that will make you look good if you die in the middle of it.
To slow it down, try putting a much lower interval in there. Maybe like 300? Just play around with some lower intervals, and it should make it wait longer before re-executing.
Timer's not going to wait long though....going to be decently speedy no matter what. It's really more useful for clock or timer type of use.
__________________ Jordan M. Wigley
Aximsite.com
Email: jordan AT aximsite.com
.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Come join the friendly community at To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
I'm actually trying to move an object across the screen..
I'm using the picturebox1.drawpicture technique and incrementing the start X value. The problem is that it SHOOTS across the screen too fast and I need it to meander across the screen.
So in my main code I'm using a
Do While variableend = false
call timer1_timer
loop
The time process has all the functionality.
It has:
private sub timer1_timer()
timer1.enabled = true
timer1.interval = 500 'I've been playing around with different numbers"
picturebox1.drawpicture
increment x value
if x > 100 then
variableend = true
timer1.enabled = false
endif
end sub
So I know that my test condition works, the object does move across the screen as required. It's just that the timer loop shoots through with no delay. Should I be calling it using a different method? call timer1_timer(500) or something?
It's got to be something simple staring me in the face.. Just my naivity is preventing me from seeing it no doubt..
__________________
Always read stuff that will make you look good if you die in the middle of it.
I think I get it.. So I should be just enabling and disbling the timer, or setting it's interval to 0 or >0 during the main program. Not actually calling it.
I think I get it, I'll try that.
Thanks for your help.
__________________
Always read stuff that will make you look good if you die in the middle of it.
I have a certain point in the program where the timer needs to execute and the program itself has to basically pause until a condition is set by the timer.
so I have
variableend = false
timer1.interval = 500
do while variableend = false
loop
and I have
timer1_timer()
do stuff in here
when conditions are met, set variableend = true
But the timer1 statements are not executing. I placed a msgbox pop-up in there and it's not appearing, instead the application now just locks...
Is this something to do with the do while loop that I have?
Thanks for the help, I really appreciate it.
__________________
Always read stuff that will make you look good if you die in the middle of it.
I don't have eVB installed here, so I'm kinda doing this from memory... You need to actually activate the timer. I think it might be something like:
timer1.enable.true or maybe timer1.enable.1
:)
__________________
Lawson Culver
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
So the timer is enabled both in the propery on the form and from within the form, I just start with with the interval at 0 and then changed it to 500 when I needed to execute the code within the timer object.
Thanks anyway :) I'll keep playing, bound to be something simple.
I tried both, but is there any real difference between form1.timer1.property and timer1.property?
Or would you use the former when referencing the timer from another form and the latter from within the form?
__________________
Always read stuff that will make you look good if you die in the middle of it.