Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


convert VB to VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,35440
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> convert VB to VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 convert VB to VBScript - 6/14/2006 11:02:58 AM   
  inantheotoko

 

Posts: 3
Score: 0
Joined: 6/14/2006
Status: offline
i am really sorry you guys, but i really don't know if my query is a valid one...

see, i have this program done using VB 6.0, it involves opening a text file, reading it, and using it, then overwriting it and reading it again for future use.
now, i have done it using VB and it executes fairly well...

the problem, i need to incorporate it in an asp...

i think i can do it by:
1. convert the VB source code to asp...
2. convert the VB to VBscript and call it using asp...

i just don't know how to... i've been working on VB for quite some time now, and am fairly knowledgeable about it, asp is something new to me though...

any help will be greatly appreciated, thanks!
 
 
Post #: 1
 
 RE: convert VB to VBScript - 6/30/2006 7:47:39 AM   
  Country73


Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
You may want to consider showing a little bit of your VB code so that we can give you an example of how to convert it to ASP / VBScript.

(in reply to inantheotoko)
 
 
Post #: 2
 
 RE: convert VB to VBScript - 7/4/2006 11:29:09 AM   
  inantheotoko

 

Posts: 3
Score: 0
Joined: 6/14/2006
Status: offline
Dim a As String, b As String, c As String, d As String, e As String, y As String
Dim endocode, endoclip, lastcheck
Private Sub cmdCancel_Click()
DisableDown
EnableUp
End Sub
Private Sub cmdChange_Click()
If IsNumeric(txtYear.Text) = False Then
   If MsgBox("Please enter a 2-digit number for Year.", vbCritical, "Year Error") = vbOK Then
   End If
   txtYear.SetFocus
ElseIf IsNumeric(Left(txtYear.Text, 1)) = False Then
   If MsgBox("Please enter a valid Year.", vbCritical, "Year Error") = vbOK Then
   End If
   txtYear.SetFocus
ElseIf IsNumeric(Right(txtYear.Text, 1)) = False Then
   If MsgBox("Please enter a valid Year.", vbCritical, "Year Error") = vbOK Then
   End If
   txtYear.SetFocus
ElseIf IsNumeric(txtIHR.Text) = False Then
   If MsgBox("Please enter a 5-digit number for IHR.", vbCritical, "IHR Error") = vbOK Then
   End If
   txtIHR.SetFocus
ElseIf IsNumeric(txtIRR.Text) = False Then
   If MsgBox("Please enter a 5-digit number for IRR.", vbCritical, "IRR Error") = vbOK Then
   End If
   txtIRR.SetFocus
ElseIf IsNumeric(txtSPP.Text) = False Then
   If MsgBox("Please enter a 5-digit number for SPP.", vbCritical, "SPP Error") = vbOK Then
   End If
   txtSPP.SetFocus
ElseIf IsNumeric(txtCON.Text) = False Then
   If MsgBox("Please enter a 5-digit number for CON.", vbCritical, "CON Error") = vbOK Then
   End If
   txtCON.SetFocus
ElseIf IsNumeric(txtOFR.Text) = False Then
   If MsgBox("Please enter a 5-digit number for OFR.", vbCritical, "OFR Error") = vbOK Then
   End If
   txtOFR.SetFocus
End If

y = txtYear.Text
a = txtIHR.Text
b = txtIRR.Text
c = txtSPP.Text
d = txtCON.Text
e = txtOFR.Text
GradeKeys
lastcheck = a
ReWriteMe
Unload Me
frmEndo.Show

End Sub
Private Sub ReWriteMe()
Open "c:\endo1.txt" For Output As #1
Write #1, a
Write #1, b
Write #1, c
Write #1, d
Write #1, e
Write #1, y
Write #1, lastcheck
Close #1

End Sub
Private Sub GradeKeys()
If Len(a) = 5 Then
   a = "IHR" & y & " - " & a
ElseIf Len(a) = 4 Then
   a = "IHR" & y & " - " & "0" & a
ElseIf Len(a) = 3 Then
   a = "IHR" & y & " - " & "00" & a
ElseIf Len(a) = 2 Then
   a = "IHR" & y & " - " & "000" & a
ElseIf Len(a) = 1 Then
   a = "IHR" & y & " - " & "0000" & a
End If
  
If Len(b) = 5 Then
   b = "IRR" & y & " - " & b
ElseIf Len(b) = 4 Then
   b = "IRR" & y & " - " & "0" & b
ElseIf Len(b) = 3 Then
   b = "IRR" & y & " - " & "00" & b
ElseIf Len(b) = 2 Then
   b = "IRR" & y & " - " & "000" & b
ElseIf Len(b) = 1 Then
   b = "IRR" & y & " - " & "0000" & b
End If
If Len(c) = 5 Then
   c = "SPP" & y & " - " & c
ElseIf Len(c) = 4 Then
   c = "SPP" & y & " - " & "0" & c
ElseIf Len(c) = 3 Then
   c = "SPP" & y & " - " & "00" & c
ElseIf Len(c) = 3 Then
   c = "SPP" & y & " - " & "000" & c
ElseIf Len(c) = 1 Then
   c = "SPP" & y & " - " & "0000" & c
End If
If Len(d) = 5 Then
   d = "CON" & y & " - " & d
ElseIf Len(d) = 4 Then
   d = "CON" & y & " - " & "0" & d
ElseIf Len(d) = 3 Then
   d = "CON" & y & " - " & "00" & d
ElseIf Len(d) = 2 Then
   d = "CON" & y & " - " & "000" & d
ElseIf Len(d) = 1 Then
   d = "CON" & y & " - " & "0000" & d
End If
If Len(e) = 5 Then
   e = "OFR" & y & " - " & e
ElseIf Len(e) = 4 Then
   e = "OFR" & y & " - " & "0" & e
ElseIf Len(e) = 3 Then
   e = "OFR" & y & " - " & "00" & e
ElseIf Len(e) = 2 Then
   e = "OFR" & y & " - " & "000" & e
ElseIf Len(e) = 1 Then
   e = "OFR" & y & " - " & "0000" & e
End If
End Sub
Private Sub cmdEdit_Click()
DisableUp
EnableDown
GradeKeys
MiddegradeMe
PopulateDown
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdUpdate_Click()
endocode = Combo.Text
endoclip = Left(endocode, 3)
MsgBox endoclip
DegradeKeys
If endoclip = "IHR" Then
   a = 1 + a
ElseIf endoclip = "IRR" Then
   b = 1 + b
ElseIf endoclip = "SPP" Then
   c = 1 + c
ElseIf endoclip = "CON" Then
   d = 1 + d
ElseIf endoclip = "OFR" Then
   e = 1 + e
Else: MsgBox "Please choose a code.", , "Error"
End If
GradeKeys
If endoclip = "IHR" Then
   lastcheck = a
ElseIf endoclip = "IRR" Then
   lastcheck = b
ElseIf endoclip = "SPP" Then
   lastcheck = c
ElseIf endoclip = "CON" Then
   lastcheck = d
ElseIf endoclip = "OFR" Then
   lastcheck = e
Else: MsgBox "Please choose a code.", , "Error"
End If
ReWriteMe
Unload Me
frmEndo.Show
End Sub
Private Sub Form_Load()
Open "c:\endo1.txt" For Input As #1
Input #1, a, b, c, d, e, y, lastcheck
Combo.AddItem a
Combo.AddItem b
Combo.AddItem c
Combo.AddItem d
Combo.AddItem e
Close #1
Combo.Text = lastcheck
DegradeKeys
End Sub
Private Sub DisableUp()
lblEndoCode.Enabled = False
Combo.Enabled = False
cmdExit.Enabled = False
cmdEdit.Enabled = False
cmdUpdate.Enabled = False
End Sub
Private Sub EnableUp()
lblEndoCode.Enabled = True
Combo.Enabled = True
cmdExit.Enabled = True
cmdEdit.Enabled = True
cmdUpdate.Enabled = True
End Sub
Private Sub DisableDown()
frameEdit.Enabled = False
lblYear.Enabled = False
lblIHR.Enabled = False
lblIRR.Enabled = False
lblSPP.Enabled = False
lblCON.Enabled = False
lblOFR.Enabled = False
txtYear.Enabled = False
txtIHR.Enabled = False
txtIRR.Enabled = False
txtSPP.Enabled = False
txtCON.Enabled = False
txtOFR.Enabled = False
cmdCancel.Enabled = False
cmdChange.Enabled = False
End Sub
Private Sub EnableDown()
frameEdit.Enabled = True
lblYear.Enabled = True
lblIHR.Enabled = True
lblIRR.Enabled = True
lblSPP.Enabled = True
lblCON.Enabled = True
lblOFR.Enabled = True
txtYear.Enabled = True
txtIHR.Enabled = True
txtIRR.Enabled = True
txtSPP.Enabled = True
txtCON.Enabled = True
txtOFR.Enabled = True
cmdCancel.Enabled = True
cmdChange.Enabled = True
End Sub
Private Sub DegradeKeys()
MiddegradeMe
a = 0 + a
b = 0 + b
c = 0 + c
d = 0 + d
e = 0 + e

End Sub
Private Sub MiddegradeMe()
a = Right(a, 5)
b = Right(b, 5)
c = Right(c, 5)
d = Right(d, 5)
e = Right(e, 5)
End Sub
Private Sub PopulateDown()
txtYear.Text = y
txtIHR.Text = a
txtIRR.Text = b
txtSPP.Text = c
txtCON.Text = d
txtOFR.Text = e
txtYear.SelLength = 2
txtIHR.SelLength = 5
txtIRR.SelLength = 5
txtSPP.SelLength = 5
txtCON.SelLength = 5
txtOFR.SelLength = 5
End Sub

Private Sub txtCON_Click()
txtCON.SelLength = 5
End Sub
Private Sub txtIHR_Click()
txtIHR.SelLength = 5
End Sub
Private Sub txtIRR_Click()
txtIRR.SelLength = 5
End Sub
Private Sub txtOFR_Click()
txtOFR.SelLength = 5
End Sub
Private Sub txtSPP_Click()
txtSPP.SelLength = 5
End Sub
Private Sub txtYear_Click()
txtYear.SelLength = 2
End Sub


here is the code... however in the asp, all i need is the combo and the update button...

(in reply to Country73)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> convert VB to VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts