Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:02:12+00:00 2026-06-18T00:02:12+00:00

I am creating a Solar PV Calculator using ASP Web Forms and VB backend.

  • 0

I am creating a Solar PV Calculator using ASP Web Forms and VB backend. I just looked at my code and being a novice VB.NET developer, I just wanted to know if there is a way to do something differently, reduce the amount of lines of code or something similar. Here’s a cumbersome part of y code:

Dim SR As Integer
    'Store radiation value
    If drpDwnRoofFacing.Text = "South" And drpAngleOfRoof.Text = "Horizontal" Then
        SR = 933
    ElseIf drpDwnRoofFacing.Text = "SE/SW" And drpAngleOfRoof.Text = "Horizontal" Then
        SR = 933
    ElseIf drpDwnRoofFacing.Text = "E/W" And drpAngleOfRoof.Text = "Horizontal" Then
        SR = 933
    ElseIf drpDwnRoofFacing.Text = "NE/NW" And drpAngleOfRoof.Text = "Horizontal" Then
        SR = 933
    ElseIf drpDwnRoofFacing.Text = "North" And drpAngleOfRoof.Text = "Horizontal" Then
        SR = 933
    ElseIf drpDwnRoofFacing.Text = "South" And drpAngleOfRoof.Text = "30 Degrees" Then
        SR = 1042
    ElseIf drpDwnRoofFacing.Text = "SE/SW" And drpAngleOfRoof.Text = "30 Degrees" Then
        SR = 997
    ElseIf drpDwnRoofFacing.Text = "E/W" And drpAngleOfRoof.Text = "30 Degrees" Then
        SR = 886
    ElseIf drpDwnRoofFacing.Text = "NE/NW" And drpAngleOfRoof.Text = "30 Degrees" Then
        SR = 762
    ElseIf drpDwnRoofFacing.Text = "North" And drpAngleOfRoof.Text = "30 Degrees" Then
        SR = 709
    ElseIf drpDwnRoofFacing.Text = "South" And drpAngleOfRoof.Text = "45 Degrees" Then
        SR = 1023
    ElseIf drpDwnRoofFacing.Text = "SE/SW" And drpAngleOfRoof.Text = "45 Degrees" Then
        SR = 968
    ElseIf drpDwnRoofFacing.Text = "E/W" And drpAngleOfRoof.Text = "45 Degrees" Then
        SR = 829
    ElseIf drpDwnRoofFacing.Text = "NE/NW" And drpAngleOfRoof.Text = "45 Degrees" Then
        SR = 666
    ElseIf drpDwnRoofFacing.Text = "North" And drpAngleOfRoof.Text = "45 Degrees" Then
        SR = 621
    ElseIf drpDwnRoofFacing.Text = "South" And drpAngleOfRoof.Text = "60 Degrees" Then
        SR = 960
    ElseIf drpDwnRoofFacing.Text = "SE/SW" And drpAngleOfRoof.Text = "60 Degrees" Then
        SR = 900
    ElseIf drpDwnRoofFacing.Text = "E/W" And drpAngleOfRoof.Text = "60 Degrees" Then
        SR = 753
    ElseIf drpDwnRoofFacing.Text = "NE/NW" And drpAngleOfRoof.Text = "60 Degrees" Then
        SR = 580
    ElseIf drpDwnRoofFacing.Text = "North" And drpAngleOfRoof.Text = "60 Degrees" Then
        SR = 485
    ElseIf drpDwnRoofFacing.Text = "South" And drpAngleOfRoof.Text = "Vertical" Then
        SR = 724
    ElseIf drpDwnRoofFacing.Text = "SE/SW" And drpAngleOfRoof.Text = "Vertical" Then
        SR = 684
    ElseIf drpDwnRoofFacing.Text = "E/W" And drpAngleOfRoof.Text = "Vertical" Then
        SR = 565
    ElseIf drpDwnRoofFacing.Text = "NE/NW" And drpAngleOfRoof.Text = "Vertical" Then
        SR = 427
    ElseIf drpDwnRoofFacing.Text = "North" And drpAngleOfRoof.Text = "Vertical" Then
        SR = 360
    End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:02:13+00:00Added an answer on June 18, 2026 at 12:02 am
    Select Case drpAngleOfRoof.Text
            Case "Horizontal"
                Select Case drpDwnRoofFacing.Text
                    Case "South" : SR = 933
                    Case "SE/SW" : SR = 933
                    Case "E/W" : SR = 933
                    Case "NE/NW" : SR = 933
                    Case "North" : SR = 933
                End Select
            Case "30 Degrees"
                Select Case drpDwnRoofFacing.Text
                    Case "South" : SR = 933
                    Case "SE/SW" : SR = 933
                    Case "E/W" : SR = 933
                    Case "NE/NW" : SR = 933
                    Case "North" : SR = 933
                End Select
            Case "45 Degrees"
                Select Case drpDwnRoofFacing.Text
                    Case "South" : SR = 933
                    Case "SE/SW" : SR = 933
                    Case "E/W" : SR = 933
                    Case "NE/NW" : SR = 933
                    Case "North" : SR = 933
                End Select
            Case "60 Degrees"
                Select Case drpDwnRoofFacing.Text
                    Case "South" : SR = 933
                    Case "SE/SW" : SR = 933
                    Case "E/W" : SR = 933
                    Case "NE/NW" : SR = 933
                    Case "North" : SR = 933
                End Select
            Case "Vertical"
                Select Case drpDwnRoofFacing.Text
                    Case "South" : SR = 933
                    Case "SE/SW" : SR = 933
                    Case "E/W" : SR = 933
                    Case "NE/NW" : SR = 933
                    Case "North" : SR = 933
                End Select
        End Select
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a default ASP.NET MVC project in Visual Studio sets up a basic project
Creating an ASP.NET AJAX Server Control. Overriding the RenderContents method, I placed in this
Creating a simple RPG game, first time using XNA. Trying to get my character
Creating a rating system and the info is not being transmitted through my $_GET
Creating a Blackberry app. Just a beginner, I have searched but couldn't find a
Creating a code where the user enters the amount of seats they want, the
Creating a small 2D game, using Direct3D 9 and C++. I have come across
Creating a couple forms and I have styled the text inputs and textareas the
creating a small web application to be deployed on Heroku, where we would like
Creating a view with following code. - (void)loadView { paintView=[[UIView alloc]initWithFrame:CGRectMake(0, 50, 320, 430)];

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.