Normal Topic Help Please .........   Hours (Read 1631 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Help Please .........   Hours
Jan 2nd, 2007 at 8:56pm
Print Post Print Post  
Embarrassed I am not worthy  Embarrassed

Hello, I am just a newbie doing my best to learn I was wanting to know can you point me in the right direction for the right "code" to work out how much time between two time point "11:25 am  3:25pm"

Thanks in advance.
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Hours
Reply #1 - Jan 2nd, 2007 at 9:12pm
Print Post Print Post  
Hello,

The code below will give you the number of minutes between two times. Replace EndTime and StartTime with the names of the time elements on your form and TimeWorked with the name of the element that you want to display the result in.

Code
Select All
TimeWorked = EndTime - StartTime 



If you want to get hours and minutes then the following code should give you start in the right direction.

Code
Select All
Var vDiff as Int
Var vHours as Int
Var vMins as Int

vDiff = EndTime - StartTime
vHours = @Int(vDiff / 60)
vMins = vDiff - (vHours * 60)

HoursWorked = vHours
MinutesWorked = vMins 



Replace EndTime and StartTime with the names of the time elements on your form. Also replace HoursWorked and MinutesWorked with the name of the elements that you want to display the result in.

Let me know if you have any Questions.

Welcome to the Forum,
Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Help Please .........   Hours
Reply #2 - Jan 2nd, 2007 at 9:27pm
Print Post Print Post  
Thank you Ray for the warm welcome,

I have tried the code  TimeWorked = EndTime - StartTime before and i come up with

Type mismatch error (operation is not defined for the types of the operands
Line 1, position 22: -
TimeWorked = EndTime - StartTime
                                  ^               


What have I done wrong????  Undecided Embarrassed

Thanks in Advance.

On a side note, I have only been using Sesame, for about 3 weeks now and I love it.

  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Help Please .........   Hours
Reply #3 - Jan 2nd, 2007 at 9:39pm
Print Post Print Post  
Hello,

In Designer click on the EndTime element
Switch to the Other Tab of the Property Viewer
What does it say next to Bound To Type?

Click on the StartTime element
On the Other Tab of the Property Viewer, what does it say next to Bound To Type?

If Bound To Type says "Text" you will need to change that to "Time". Instructions for changing Field Type can be found on pages 138-139 of the Sesame 1.1 User Guide.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Help Please .........   Hours
Reply #4 - Jan 2nd, 2007 at 9:42pm
Print Post Print Post  
Embarrassed Embarrassed Embarrassed Embarrassed Embarrassed Embarrassed

ooooooooo that was such a newbie mistake.  Shocked Shocked Shocked Shocked



Thank you so much Ray once again.




"A mistake is only a mistake if you don't learn from it"
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Help Please .........   Hours
Reply #5 - Jan 2nd, 2007 at 9:46pm
Print Post Print Post  
drastixnz wrote on Jan 2nd, 2007 at 9:42pm:
ooooooooo that was such a newbie mistake.  Shocked Shocked Shocked Shocked

Don't feel bad, I've made that same mistake more times than I would like to admit.

Quote:
Thank you so much Ray once again.

You are most welcome.
-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged