Anyone can explain what does these codes do? [VB]

Hi,

I'm very new to VB, can anyone pls explain what does these codes do?

_______________________________________________________________________________
Public Sub syn_time()
Dim xsec%, xmin%, xhour%, xday%, xmonth%, xyear%
Dim x, y, z As Object
Dim strdate As String, strtime As String

On Error GoTo xerr

Set x = gTagDb.GetTag("xTIME\SECOND")
Set y = gTagDb.GetTag("xTIME\MINUTE")
Set z = gTagDb.GetTag("xTIME\HOUR")

strtime = Str(z) & ":" & Str(y) & ":" & Str(x)
'Time = strtime

Set x = gTagDb.GetTag("xTIME\MONTH")
Set y = gTagDb.GetTag("xTIME\DAY")
Set z = gTagDb.GetTag("xTIME\YEAR")

strdate = Str(x) & "/" & Str(y) & "/" & Str(z) 'mm/dd/yyyy
'Date = strdate
xerr:
End Sub
________________________________________________________________________________

Thanks. Appreciate :)
ckchew666Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PodExpertCommented:
The code just picks up date and time information from database (probably GAP4 DNA Assembly program database) and puts it in Date and Time variables (probably for further processing). That's all.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bochgochCommented:
...Uses the GetTag function to extract time / date elements from a global - gTagDb, and then builds strings containing the appropriatelty formatted strings...

GetTag is not a core VB function, there is a VBA scripting language extension called CIMScan that has this function. Alternatively this may be a function developed in your App., take a look for the code!

0
stumpy1Commented:
I have put explanatory comments in code below.
Public Sub syn_time()
Dim xsec%, xmin%, xhour%, xday%, xmonth%, xyear%
Dim x, y, z As Object
Dim strdate As String, strtime As String

On Error GoTo xerr

Set x = gTagDb.GetTag("xTIME\SECOND") 'Gets second value from xTIME and assigning to x
Set y = gTagDb.GetTag("xTIME\MINUTE") 'Gets minute value from xTIME and assigning to y
Set z = gTagDb.GetTag("xTIME\HOUR") 'Gets hour value from xTIME and assigning to z

strtime = Str(z) & ":" & Str(y) & ":" & Str(x) 'formats the time as hour:min:sec, eg 10:51:01
'Time = strtime

Set x = gTagDb.GetTag("xTIME\MONTH") 'Gets month value from xTIME and assigning to x
Set y = gTagDb.GetTag("xTIME\DAY") 'Gets day value from xTIME and assigning to y
Set z = gTagDb.GetTag("xTIME\YEAR") 'Gets year value from xTIME and assigning to z

strdate = Str(x) & "/" & Str(y) & "/" & Str(z) 'mm/dd/yyyy 'formats the date as month/day/year, eg 11/09/2004
'Date = strdate
xerr:
End Sub

I dont know what the definition or xTIME is so a certain amount of thgis is guesswork
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.