Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Gamer
23
Years of Service
User Offline
Joined: 29th Apr 2003
Location:
Posted: 2nd May 2003 01:20
I'm new to DBPro...My question is, in VB there's a Timer control that would fire up a piece of code according to the time interval that you set in the Interval property. Does DBPro have some similar commands to do the job? Or do we have to write our own code to do that?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd May 2003 01:25 Edited at: 2nd May 2003 01:26
No, DBPro hasn't got a similar command - as I said to someone else who asked the same question is that you've have to write a Windows routine that creates a timer (high-frequence of even WM_TIMER), get that to call a function and then pass the data back to a memory address in DBPro...

The problem with this is that the data passed back only when you read it...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 01:25
You have to write your own I'm afraid
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:28
Taken straight from "C:\Program Files\Dark Basic Software\Dark Basic Professional\Help\commands\core\TIMER.htm"

TIMER
This command will get the internal system time, which continually increments at a thousand times a second. The system time is returned in milliseconds, where 1000 units represent 1 second.

SYNTAX
Return Integer=TIMER()

So I think if you put this somewhere, possibly in a loop something like:
REPEAT
source code
source code
source code
UNTIL TIMER()=10000 `10000 been 10 seconds
I don't know though because I've never had to use this command and am new myself, let me know how it goes.

I hear and I forget. I see and I remember. I do and I understand.
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:29
Toad and Ian beat me to it, even though when I clicked to reply there were no other replies hehe.

I hear and I forget. I see and I remember. I do and I understand.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd May 2003 01:29
Its not quite what he meant - he wants a function to be called every so often...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:32
Ok, I'm new to this stuff as well as Gamer, just trying to help out when I can and to the best of my ability.

I hear and I forget. I see and I remember. I do and I understand.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 01:33
The way to do it is this:

Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:35
Ian how come you have the colon after the 500? Is it needed syntax? (Just out of curiosity).

I hear and I forget. I see and I remember. I do and I understand.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 01:38
It's just to allow me to put a comment on the same line.
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:52
Ahhh, ok thankyou, never knew that, that will indefinately come in handy; cheers.

I hear and I forget. I see and I remember. I do and I understand.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2003 04:19
Visual Basic is primarily an event driven development system, but a similar more simpler approach could be applied to DBPro using the system timer.

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
Gamer
23
Years of Service
User Offline
Joined: 29th Apr 2003
Location:
Posted: 2nd May 2003 06:26
Thanks for the help, guys. I guess I'll have to write my own code.
By the way, how do I split a long line of code into more than one line?
What's the continuation character? I tried the underscore character but it didn't work.

CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 2nd May 2003 07:18
either double undersore or 3 dots i think

Neophyte
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 2nd May 2003 09:41
@Gamer

"By the way, how do I split a long line of code into more than one line?
What's the continuation character?"

You can find it under tools->System Options->Concatenation symbol.
Ohh, and make sure you have the latest version of the IDE. I'm not sure but I don't remember the option to select the concatenation symbol being in the previous verision. You can find the latest IDE update here: http://www.realgametools.com/downloads.html#updates.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2003 11:52
Yeah, I cried out for ON TIMER style commands a while back. They cannot really be replaced using that condition code, because the whole usefullness comes from the psuedo multi-tasking you get from automated timer checks. GFA on the Atari ST had this, and that was about 10 years ago, without using a form control though - it was as simple as ON TIMER 1000 GOSUB Subroutine_name.

An example of how useful this would be is VSD Tracker, if I could simply setup a timed music replay routine, then it'd make the playback much smoother, faster, and completely independent from the main loop.

I want it so bad it hurts sometimes.


Van-B
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd May 2003 11:55
The problem with doing it my way is that the data read is only read when you want it to be. An ON TIMER command would certainly be very handy...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Ratty Rat
23
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 2nd May 2003 14:00
Van B - You make a good point here, I always though that a VB style timer (or anything else similar) would not work in DB because its procedural rather than event driven (IE you have to detect events like key presses, mouse moves etc rather than having a system that 'jumps' to code when the event occurs).

But I had forgotten about how GFA Basic (I had the Amiga version) handled this, I certainly think that such an event handler could be included in DBPro, and you could add other events (on keypress, on mousekey, on joystickkey and for your point how about 'on musiccomplete' ) . Even better would be if it could call functions.....

Of course there may be things in the way DBPro is written that would make this difficult to implement, you`d have to ask Lee or Rich I suppose.

"Don`t try to engage my enthusiasm, I don`t have one"
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2003 14:14
Or the ultimate command...

ON ERROR RESUME NEXT!!!


Van-B
bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd May 2003 14:15
ya, thinking of it, i requested an ON ERROR routine a long time ago, it'd be kinda handy..

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd May 2003 14:16
LMAO that post when i sent my message, vanb... looks like we are on the same wavelength

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2003 15:39
Van B, I still have the GFA Basic disks and GFA Raytrace for the Atari ST, even the compiler for GFA. Wow, that brought back memories. LOL

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2003 16:28
Hehe, did you know raytrace was actually written in GFA (mostly anyway)? - I loved GFA!. I bought an add on called Sprite Works, which made it a totally awesome game engine with blitter commands and soundtracker support - too late in the ST's life unfortunately.

I gave the newest PC windows shiny lovely version a go - but it wasn't the same somehow.


Van-B
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2003 16:35
Van B, <gg>, detracting from the current subject but you may be interested in looking at http://www.atari.st/

It's got loads of resources on Atari

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.

Login to post a reply

Server time is: 2026-07-11 06:06:47
Your offset time is: 2026-07-11 06:06:47