|
|
|
186
   
Group: Forum Members
Last Login: 24/11/2008 12:20:06
Posts: 39,
Visits: 98
|
|
Ok I know this is probably very very easy but I can't find the command to change a string to an integer as far as vbscript is concerned. Have Tried Cint but that gives type mismatch. My code is below am pulling a text sttring (time) from a database, splittign it then adding it to another time ( Takeoff + Duration = land) Just need the command to convert the string to integer please. Do not need whole chunk of code writing as it has to do this 116 time per row of table so trying to do stuff in a set way.
Hope some-one knows the answer to this simple question. The general idea is in the code below.
'Set 1st time in plot table
StartTimeH = 5
StartTimeM = 30
'Calculate land time based on t_o or atd
TakeOffH = left(Recordset1.Fields.Item("t_o").Value,2)
TakeOffM = right(Recordset1.Fields.Item("t_o").Value,2)
DurnH = LEFT(Recordset1.Fields.Item("dur").Value,1)
DurnM = RIGHT(Recordset1.Fields.Item("dur").Value,2)
'Minutes First
LandM = TakeOffM + DurnM
' Add an hour to land if minutes sum is over 60
If LandM => 60 then
LandM = LandM - 60
LandH = LandH + 1
End If
' Then Hours
LandH = TakeOffH + DurnH
' Allow for Midnight
If LandH = 24 then LandH = 0 : End If
If LandH >24 then LandH = LandH -24 : End If
__________________________________________________________________________ We trained hard, but it seemed every time we were beginning to form up into teams, we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising, and a wonderful method it can be for creating the illusion of progress while producing confusion, inefficiency and demoralisation.
|
|
|
|