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

  • SEARCH
  • Home
  • 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 4061340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:27:18+00:00 2026-05-20T15:27:18+00:00

I’m having trouble with a for loop in my program. Right now I have

  • 0

I’m having trouble with a for loop in my program. Right now I have two arrays that are populated with arbitrary numbers. These two arrays are the same size. Basically I want the user to specify what sort of operation they want done on the arrays and then I’ll perform them (given that the arrays are the same dimensions). Below is the code for me trying to populate an answer array with the difference between the original two arrays:

If (LCase(diffOrPercent = "difference")) Then
    For iRow = 1 To totalRow
        For iCol = 1 To totalCol
            answerArray(iRow, iCol) = s2Array(iRow, iCol) - s3Array(iRow, iCol)
        Next iCol
    Next iRow
End If

The problem that I’m having is that the answerArray is entirely blank when I try to print it out. Does anyone know what’s going on?

Note: The same error occurs if the for loops go from 0 to end – 1, when i put the following:

answerArray(iRow, iCol) = s2Array(iRow, iCol).Value2 - s3Array(iRow, iCol).Value2

As well as when I put Value instead of Value2.

Thank you,

Jesse Smothermon

  • 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-05-20T15:27:19+00:00Added an answer on May 20, 2026 at 3:27 pm

    I figured it out, the if statement was written incorrectly so the operation portion of the code wasn’t even being hit. I screwed up the parenthesis on LCase, so the correction is below

    If (LCase(diffOrPercent) = "difference") Then
        For iRow = 1 To totalRow
            For iCol = 1 To totalCol
                answerArray(iRow, iCol) = s2Array(iRow, iCol) - s3Array(iRow, iCol)
            Next iCol
        Next iRow
    End If
    

    This makes it so that the variable diffOrPercent will be all lowercase instead of….. well I don’t think anything happens when my original if statement is implemented which makes sense because nothing within the if statement gets hit. Sorry that I completely wasted everyone’s time on this one, but I really appreciate all of the quick responses

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.