big-dog1965 Posted January 5, 2009 Share Posted January 5, 2009 Can someone help me with this I want to convert some vb code into php Im not a programmer so I need all the help I can get. I have several vb code pages to convert, but Im thinking if I can see how this one would look I might beable to figure the rest out by excample. Option Compare Database Public XTrk_Name As String Public XTrk_Oper As String Public XTrk_Short_Name As String Public XTrk_Desc As String Public XTrk_ID As Long Public XHome_ID As Long Public XHomeSet As Boolean Public Sub SetHomeTrack() Dim VarX As Variant VarX = "" VarX = DLookup("[Trk_Name]", "Track_Master", "[Trk_Home] = True") If Nz([VarX], "") = "" Then XTrk_Name = "Points Management System" XHomeSet = False Else XTrk_Name = VarX XHomeSet = True End If VarX = "" VarX = DLookup("[Trk_Short_Name]", "Track_Master", "[Trk_Home] = True") If Nz([VarX], "") = "" Then XTrk_Short_Name = "Home Trk Not Setup" Else XTrk_Short_Name = VarX End If VarX = "" VarX = DLookup("[Trk_Oper]", "Track_Master", "[Trk_Home] = True") If Nz([VarX], "") = "" Then XTrk_Oper = "Home Oper Not Setup" Else XTrk_Oper = VarX End If VarX = "" VarX = DLookup("[Trk_Desc]", "Track_Master", "[Trk_Home] = True") If Nz([VarX], "") = "" Then XTrk_Desc = "Home Desc Not Setup" Else XTrk_Desc = VarX End If VarX = "" VarX = DLookup("[Trk_ID]", "Track_Master", "[Trk_Home] = True") If Nz([VarX], "") = "" Then XTrk_ID = 0 XHome_ID = 0 Else XTrk_ID = VarX XHome_ID = VarX End If End Sub Function ParseTime(InTime, Outtime) 'Determine The Format For x = 1 To Len(InTime) If Mid(InTime, x, 1) < 0 Or Mid(InTime, x, 1) > 9 Then Mid(InTime, x, 1) = ":" End If Next x Outtime = InTime End Function Function IsLoaded(ByVal strFormName As String) As Integer ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If End Function Public Function GetHomeTrack(Track_Data, Get_Data) Select Case Get_Data Case 1 VarX = "" VarX = DLookup("[Trk_Name]", "Track_Master", "[Trk_Home] = True") Track_Data = VarX If Nz([VarX], "") = "" Then If Not IsLoaded("CM_TRK_MASTER_01") Then Msg = "You must setup at least one Track as the Home Track" & Chr(10) & Chr(13) Msg = Msg & "Open the Track Master Control Setup and Select a Home Track" MsgBox Msg Cancel = True End If Else Home_Setup = True End If Case 2 VarX = "" VarX = DLookup("[Trk_Short_Name]", "Track_Master", "[Trk_Home] = True") Track_Data = VarX Case 3 VarX = "" VarX = DLookup("[Trk_Oper]", "Track_Master", "[Trk_Home] = True") Track_Data = VarX Case 4 VarX = "" VarX = DLookup("[Trk_Desc]", "Track_Master", "[Trk_Home] = True") Track_Data = VarX Case 5 VarX = "" VarX = DLookup("[Trk_ID]", "Track_Master", "[Trk_Home] = True") Track_Data = VarX End Select VarX = "" End Function Link to comment https://forums.phpfreaks.com/topic/139604-visual-basic-in-a-php-file/ Share on other sites More sharing options...
Adam Posted January 5, 2009 Share Posted January 5, 2009 I don't have time to rewrite this now but I'll help you while I'm at work tomorow... Mr.A Link to comment https://forums.phpfreaks.com/topic/139604-visual-basic-in-a-php-file/#findComment-730378 Share on other sites More sharing options...
big-dog1965 Posted January 6, 2009 Author Share Posted January 6, 2009 Thanks that would be great THANKS Link to comment https://forums.phpfreaks.com/topic/139604-visual-basic-in-a-php-file/#findComment-730417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.