|

Public
Class frmMain Inherits System.Windows.Forms.Form
Function baseN2dec(ByVal value, ByVal inBase) As String
'Converts any base to base 10
Dim strValue, i, x, y
strValue = StrReverse(CStr(UCase(value)))
For i = 0 To Len(strValue) - 1
x = Mid(strValue, i + 1,
1)
If Not IsNumeric(x) Then
y = y + ((Asc(x) - 65) + 10) * (inBase ^ i)
Else
y = y + ((inBase ^ i) * CInt(x))
End If
Next
baseN2dec = y
End Function
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub cmdCompute_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cmdCompute.Click
txtOV.Text = (Val(txtFSO.Text) / 15) *
baseN2dec(Val(txtIC.Text), 2)
End Sub
End
Class |