How to Sum Variables in a Function?

# Thread: How to Sum Variables in a Function?

1. Alex Polajenko Guest

## How to Sum Variables in a Function?

What is the correct way to code the sum of these variables? <BR><BR>Dim intEarlyBird <BR><BR>Function EarlyRegPrice() <BR>Dim intReg1, intReg2, intReg3 <BR><BR>Select Case strReglType &#039;registration type from the first grouping <BR>Case Individual <BR>intReg1 = 105 <BR>Case Spouse <BR>intReg1 = 95 <BR>Case ActivePulpitPastor <BR>intReg1 = 75 <BR>Case SpecialStudentRate <BR>intReg1 = 75 <BR>Case Else -- <BR>Response.Redirect "ErrorType.asp" <BR><BR>End Select <BR><BR>Select Case strReg2Type &#039;registration type from the second grouping <BR>Case Individual <BR>intReg2 = 105 <BR>Case Spouse <BR>intReg2 = 95 <BR>Case ActivePulpitPastor <BR>intReg2 = 75 <BR>Case SpecialStudentRate <BR>intReg2 = 75 <BR>Case Else -- <BR>Response.Redirect "ErrorType.asp" <BR><BR>End Select <BR><BR>Select Case strReg3Type &#039;registration type from the third grouping <BR>Case Individual <BR>intReg3 = 105 <BR>Case Spouse <BR>intReg3 = 95 <BR>Case ActivePulpitPastor <BR>intReg3 = 75 <BR>Case SpecialStudentRate <BR>intReg3 = 75 <BR>Case Else -- <BR>Response.Redirect "ErrorType.asp" <BR><BR>End Select <BR><BR><BR>intEarlyBird = sum(intReg1 + intReg3)&#039;this can not be right

2. Steve Cimino Guest

## RE: Stop overcomplicating things

It&#039;s so easy you&#039;ll probably scream...<BR><BR>intEarlyBird = intReg1 + intReg2 + intReg3

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•