PDA

View Full Version : VBA Project - Registration process



ainaedil
04-06-2012, 06:17 AM
I need to understand the code below.

please help.

Private Sub submit_Click()
Dim LicensedTo As String, RegistrationKey As String, Email As String
LicensedTo = Trim(Me.editLicensedTo.Text)
RegistrationKey = TrimAll(Me.editRegistrationKey.Text)
Email = TrimAll(Me.editEmail.Text)
If (GetEvaluationDaysLeftNum() <= 0 And IsEvaluationResetPassword(RegistrationKey)) Then
If DoMsgBox("Do you wish to extend your evaluation period?", vbQuestion + vbYesNo) = vbYes Then
ExtendEvaluationPeriod
Me.Hide
End If
ElseIf (DoMsgBox(QUEST_LICENSED_TO_1 & LicensedTo & QUEST_LICENSED_TO_2, vbQuestion + vbYesNo) = vbNo) Then
TextBoxSetFocusAndSelectContents Me.editLicensedTo
Else
Dim szErrMsg As String
SetWaitCursor True
If RegistrationKey <> GetLicenceHashPreReg(Email) Then
SetWaitCursor False
DoMsgBoxWithSalesLinks ERR_REGISTRATION_KEY_OR_EMAIL_ADDRESS_INCORRECT
TextBoxSetFocusAndSelectContents Me.editEmail
ElseIf Not CanUseLicenceHash(szLicensedTo, Email, RegistrationKey, ErrMsg) Then
SetWaitCursor False
DoMsgBox ErrMsg
TextBoxSetFocusAndSelectContents Me.editRegistrationKey
Else
SetWaitCursor False
Me.Hide
End If
End If
End Sub

Aussiebear
04-06-2012, 06:30 AM
What is your issue with the code?

ainaedil
04-06-2012, 06:43 AM
Well thank you.

I am new to this, I wanted someone could explain what this code means in simple langauge.

Thank you.

Bob Phillips
04-06-2012, 06:58 AM
It checks a few things and does a few things depending upon the outcome, but all of those things are elsewhere so not much more we can say.

ainaedil
04-06-2012, 07:30 AM
what is 'GetLicenceHashPreReg(szEmail)'

thanks

Aussiebear
04-06-2012, 07:50 AM
As I read it, you would have received an email with a regristration key

Bob Phillips
04-06-2012, 11:59 AM
It is a function that takes a string as an argument, and returns some value. Other than that, no idea, we can't see the code.