473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Add 80:00:00 with 10:00:00 with vb6

228 100+
With vb6,

how can i add the above time to return 90:00:00

something like this:

http://www.unitarium.com/time-calculator
Oct 19 '10 #1
1 1335
Guido Geurs
767 Expert 512MB
Begin:
Add to the form the textboxes with index=0
Textboxes for : Operation(0) , Hours(0) , Min(0) , ...

The best way is to go in 3 steps:

1- Update display on clicking the Operation command (+, -, ..):
Add textboxes with "Load" from the original ones (Operation(0) , Hours(0),...) with index= ubound + 1
set the Top of the new textboxes in function of the index like:

Expand|Select|Wrap|Line Numbers
  1.    Load Text1(Text1.UBound + 1)
  2.    Text1(Text1.UBound).Top = Text1(Text1.UBound - 1).Top + 600
  3.    Text1(Text1.UBound).Visible = True
2- calculate in function of the Operation command.
!!! calculate with the lowest unit (sec, milsec, ...)=
If the lowest unit= sec. => set hours to sec, set min to sec,... make the operations for index (of one component like: TextboxHours) from Lbound to Ubound.

Expand|Select|Wrap|Line Numbers
  1. for i= textHours.lbound to textHours.ubound
  2.    Select case Operation(i).caption
  3.    case "+": Result= Result + (textHours(i)*3600) + (textMin(i)*60) +...
  4.    case "-": Result=Result - ...
  5.    end select
  6. next
3- Adapt the display in function of the result=
hours= int(result/3600)
minutes = int((result - hours )/60)
...
Oct 20 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jorge King | last post by:
qim ----KZbS7hrbznJi92oKn Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html><head><style type=3Dtext/css>.eyebrow { FONT-WEIGHT: bold; FONT-SIZE= : 10px;...
0
by: Mike T. | last post by:
Hi, I'm trying to install PySol on 10.0. I've tried two routes: the RPM and building from source. First, from RPM. I su'd to root and run the following: linuxdell:/home/mike # rpm -i...
0
by: Sally Whitfield | last post by:
8Zcc ----uMyItidGBFcIxNvn7Ubo Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html><head><style type=3Dtext/css>.eyebrow { FONT-WEIGHT: bold; FONT-SIZE= : 10px;...
14
by: Michael Barrido | last post by:
I have this for example: Dim iSeconds as int32 = 3600 '3600 seconds is one hour How do i convert it to "01:00:00" ? Please help. Thanks in advance!
17
by: Kermit Piper | last post by:
Hello, I have been searching, Googling, searching. Cannot find a javascript to calc 10, 11 or 12 digit UPC codes. I just need an algorithm that calcs to verify the correct check digit. I have...
23
by: Babak | last post by:
Hi Everyone, I've written a standard C code for a simple finite element analysis in MSVC++ . When I save the file as a cpp file, it compiles and runs perfectly, but when I save it as a c file,...
1
by: Drum2001 | last post by:
This is references to the post # 11 of the following thread.. Click link to view entire thread: ...
3
by: | last post by:
I'm trying to create a project on a virtual server that runs on port 8000, rather than port 80. I tried creating the project at http://localhost:8000/MyFolder but it keeps telling me that the file...
2
by: John Kelly | last post by:
Pardon me if this is a FAQ. I searched, but got far too many hits to find the answer. Question: Why is the date: Thu, 19 Nov 1981 08:52:00 GMT used as the value for anti-caching Expires:...
3
by: menzies | last post by:
Hi, I"m new to this forum, but I have been trying all day to install DBD::mysql onto my Intel MacBook. I've read lots of forums pages and none have gotten me to a successful 'make test' or a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.