forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


@timer(1,v)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 18, 2003 2:55 am    Post subject: @timer(1,v) Reply with quote

hi all,

i wrote a program that uses timers and that makes use of @timer(1,v)

a user has reported a problem with the code that follows on from the return of @timer(1,v) and i was wondering if different o/s report something different when that call is made

i am using win me and my program works fine, he is using w2k and reports a problem

here is the part of the code that causes a problem for him, and it would be the case if @timer(1,v)returns a different string under w2k then it does under win me

Code:
%%timer = @timer(1,v)
      if @equal(@len(%%timer),15)
         dialog set, text11, @substr(%%timer,10,13)
         %%minutes = @substr(%%timer,9,10)
         %%seconds = @substr(%%timer,12,13)
      elsif @equal(@len(%%timer),14)
         dialog set, text11, @substr(%%timer,8,12)
         %%minutes = @substr(%%timer,8,9)
         %%seconds = @substr(%%timer,11,12)
      end
      %%total_time = @fadd(@fmul(%%minutes,60),%%seconds)
      %%time_frac = @format(@fmul(@fdiv(%%total_time,@fmul(3,60)),100),2.0)
      dialog set, level1, %%time_frac


what i am trying to do in the code is extract the amount of minutes and seconds from the return of @timer(1,v) and the update a level bar

thanks for your help in advance

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Mar 18, 2003 3:12 am    Post subject: Reply with quote

In your code you have:
elsif @equal(@len(%%timer),14)
I think that might gave ya some problems Smile

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 18, 2003 3:35 am    Post subject: Reply with quote

thanks snarling sheep but i find that the output of @timer(1,v) is either 14 or 15 characters long (under me) and i need to deal with both possibilities

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Mar 18, 2003 3:38 am    Post subject: Reply with quote

I understood that part, but as far as I know "elsif" is not a part of VDS Smile
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 18, 2003 3:44 am    Post subject: Reply with quote

Hey Sheep,

Actually "elsif" is a new command introduced in VDS 4. Or at least VDS 4.5
because it's in my documentation and I also use it. Smile

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 18, 2003 3:49 am    Post subject: Reply with quote

Hi Serge,

How are you setting the initial value of the timer? I mean what time format
are you using?

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Mar 18, 2003 3:50 am    Post subject: Reply with quote

Doh, I never noticed it. I even tried it to make sure, it didn't turn bold in the IDE so I figured it didn't exist.
Turns bold now though and works.
So, don't mind me..the length is either 14 or 15 for me on XP Pro here.
Any way to find out what the length actually was on the users system?
Only thing I can think of(now that I've been proven stupid..that was hard huh?) is it could possibly have something to do with regional settings.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 18, 2003 3:57 am    Post subject: Reply with quote

lol, I wasn't trying to make ya feel stupid Sheep. Shocked Sorry Embarassed
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Mar 18, 2003 3:58 am    Post subject: Reply with quote

LoL, I do a good enough job on my own, trust me Wink
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 18, 2003 4:00 am    Post subject: Reply with quote

Sheep, I think you might be onto something with the Regional settings
suggestion.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 18, 2003 9:51 am    Post subject: Reply with quote

thanks for your help guys Smile

i will write a small program that will put into a text file what my user gets when vds runs @timer(1,v)...it'll be interesting to see what the problem might be

as for the regional setting, i would be surprised by that because the user is in australia same as me

would it be possible for me to see what various o/s return when vds issues a @timer(1,v) command, perhaps the structure is different even though the length is the same

could i have, pretty please, the return string of @timer(1,v) for nt, xp, xp pro and w2k...just in case there's something i'm missing

thanks in anticipation

Serge
ps my user ran the program on win95 and has no problems, but he can't run under w2k

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Mar 18, 2003 5:21 pm    Post subject: Reply with quote

Give us an example of the timer you are using in your program Serge so we can make sure we test it right. Smile
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Mar 19, 2003 7:29 am    Post subject: Reply with quote

now i am really puzzled

i wrote a test program that records what @timer(1,v) returns and this is what my user obtained
Code:
19 - 00:00:58:9
19 - 00:00:57:9
19 - 00:00:56:9
19 - 00:00:55:9


if i run the same test program on my computer, i obtain
Code:
19 - 00:00:59:0
19 - 00:00:58:0
19 - 00:00:57:0
19 - 00:00:56:0


my test program is as follows
Code:
%%time_separator_1 = @datetime(:)
  %%time_separator_2 = @datetime(:)00
  timer start, 1, ctdown, @datetime(dd)-00%%time_separator_1"1"%%time_separator_2
  %%timer_status = on
 
  list create, 1
 
  %i = 1
 
  repeat
      wait 1
    list add, 1, @timer(1,v)
    %i = @succ(%i)
  until @equal(%i,70)
 
  list savefile, 1, @windir()\desktop\timer.txt
 
  list close,1


in the test program i used the timer the same way that i do in my actual program as shown below:
Code:
rem === starts timer ===
  %%time_separator_1 = @datetime(:)
  %%time_separator_2 = @datetime(:)00
  timer start, 1, ctdown, @datetime(dd)-00%%time_separator_1"3"%%time_separator_2
  %%timer_status = on
 
  gosub read_registry      
 
:timer
  wait event,1
 
  if @equal(%%timer_status,on)
      rem === updates timer information ===
      %%timer = @timer(1,v)
      if @equal(@len(%%timer),15)
         dialog set, text11, @substr(%%timer,10,13)
         %%minutes = @substr(%%timer,9,10)
         %%seconds = @substr(%%timer,12,13)
      elsif @equal(@len(%%timer),14)
         dialog set, text11, @substr(%%timer,8,12)
         %%minutes = @substr(%%timer,8,9)
         %%seconds = @substr(%%timer,11,12)
      end
      %%total_time = @fadd(@fmul(%%minutes,60),%%seconds)
      %%time_frac = @format(@fmul(@fdiv(%%total_time,@fmul(3,60)),100),2.0)
      dialog set, level1, %%time_frac
 
      if @equal(%%time_frac,0)
         goto minimise_bBUTTON
      end
  end


my user reports that the program runs well under win 95 (as it does on my me machine) but his xp machine reports an error at the following line
Code:
%%total_time = @fadd(@fmul(%%minutes,60),%%seconds)


the error reported is that the program is trying to do maths with non maths entries!

i am puzzled!!!

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Wed Mar 19, 2003 8:01 am    Post subject: Reply with quote

I have one question for ya Serge. The following code:
Code:

@format(@fmul(@fdiv(%%total_time,(@fmul(3,60)),100),2.0)


Is it supposed to act similar to a percentage counter?

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Wed Mar 19, 2003 8:35 am    Post subject: Reply with quote

Please disregard my previous post. I'm running Windows 98SE and I can't
duplicate the problem on my machine.

I do, however, have a couple of suggestions:
1) the %%time_separator_1 and %%time_separator_2 variables are not
necessary. Mainly because they make the code hard to read and they
don't serve any real purpose.

2) You can just as easily set the timer like this:
Code:

timer start,1,ctdown,@datetime(dd)-00:03:00


But like I said, I can't duplicate the error on my machine, so I'm afraid I'm
not gonna be much help. Shocked I gave it a shot, sorry. Confused

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group