|
-
Feb 27th, 2001, 12:52 PM
#1
Thread Starter
PowerPoster
What is the correct way to code the sum of these variables?
Dim intEarlyBird
Function EarlyRegPrice()
Dim intReg1, intReg2, intReg3
Select Case strReglType 'registration type from the first grouping
Case Individual
intReg1 = 105
Case Spouse
intReg1 = 95
Case ActivePulpitPastor
intReg1 = 75
Case SpecialStudentRate
intReg1 = 75
Case Else --
Response.Redirect "ErrorType.asp"
End Select
Select Case strReg2Type 'registration type from the second grouping
Case Individual
intReg2 = 105
Case Spouse
intReg2 = 95
Case ActivePulpitPastor
intReg2 = 75
Case SpecialStudentRate
intReg2 = 75
Case Else --
Response.Redirect "ErrorType.asp"
End Select
Select Case strReg3Type 'registration type from the third grouping
Case Individual
intReg3 = 105
Case Spouse
intReg3 = 95
Case ActivePulpitPastor
intReg3 = 75
Case SpecialStudentRate
intReg3 = 75
Case Else --
Response.Redirect "ErrorType.asp"
End Select
intEarlyBird = sum(intReg1 - intReg16)
-
Feb 27th, 2001, 01:07 PM
#2
_______
<?>
Code:
'One Way
Dim intEarlyBird
Public Function EarlyRegPrice(one As Double, two As Double, three As Double) As Double
intEarlyBird = (one + two + three)
EarlyRegPrice = intEarlyBird
End Function
Public Sub getReg()
Dim intReg1 As Double, intReg2 As Double, intReg3 As Double
Select Case strReglType 'registration type from the first grouping
Case Individual
intReg1 = 105
Case Spouse
intReg1 = 95
Case ActivePulpitPastor
intReg1 = 75
Case SpecialStudentRate
intReg1 = 75
'Case Else --
'Response.Redirect "ErrorType.asp"
End Select
Select Case strReg2Type 'registration type from the second grouping
Case Individual
intReg2 = 105
Case Spouse
intReg2 = 95
Case ActivePulpitPastor
intReg2 = 75
Case SpecialStudentRate
intReg2 = 75
'Case Else --
'Response.Redirect "ErrorType.asp"
End Select
Select Case strReg3Type 'registration type from the third grouping
Case Individual
intReg3 = 105
Case Spouse
intReg3 = 95
Case ActivePulpitPastor
intReg3 = 75
Case SpecialStudentRate
intReg3 = 75
'Case Else --
'Response.Redirect "ErrorType.asp"
End Select
'some dummy info for testing
strReglType = "Spouse"
strReg2Type = "SpecialStudentRate"
strReg3Type = "ActivePulpitPastor"
MsgBox EarlyRegPrice(intReg1, intReg2, intReg3)
End Sub
Private Sub Command1_Click()
getReg
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Feb 27th, 2001, 01:11 PM
#3
Thread Starter
PowerPoster
Great Thanks but I am writing this in ASP. Will this syntax also work?
-
Feb 27th, 2001, 01:15 PM
#4
_______
<?>
For ASP I do believe you need to use VBScript or JavaScript and I don't know enought about either to lend a hand. Check around for ASP Forums..there are a lot of them and I do believe some of the pjeople here could help as well.
Sorry.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|