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 6621755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:18:37+00:00 2026-05-25T21:18:37+00:00

Consider the declarations Dim x As Double Dim avg(1 To 10) As Double What

  • 0

Consider the declarations

Dim x As Double
Dim avg(1 To 10) As Double

What are the default values in x and avg?

Through testing, I want to say that x is initialized to zero.
Likewise, I want to say that all elements in avg were initialized to zero.

However, can I write code that depends on this? Or are the default initialization values actually indeterminate?

  • 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-25T21:18:38+00:00Added an answer on May 25, 2026 at 9:18 pm

    If you specify a data type but do not specify an initializer, Visual Basic initializes the variable to the default value for its data type, which for all numeric types is 0 (zero).

    When you run a macro, all the variables are initialized to a value. A
    numeric variable is initialized to zero, a variable length string is
    initialized to a zero-length string (""), and a fixed length string is
    filled with the ASCII code 0. Variant variables are initialized to
    Empty. An Empty variable is represented by a zero in a numeric context
    and a zero-length string ("") in a string context.

    Ref. Link dead.

    Instead: How to use variables in Excel sub-procedures in Visual Basic for Applications

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

Sidebar

Related Questions

Consider this classic example used to explain what not to do with forward declarations:
Consider this problem: I have a program which should fetch (let's say) 100 records
Consider the below 2 declarations. * appears next to the datatype and not next
In C, function declarations can be prototype or non-prototype declarations. For example, consider the
Why does C++ have public members that anyone can call and friend declarations that
Consider the following declarations of a std::vector (taken from cplusplus - EASTL has the
consider the following class declarations: namespace X { template<class T> class Foo { public:
How do you provide default arguments to a Tcl procedure that are evaluated at
Please consider this example: ( working example ) Style declarations: body {background:#333;font:1em Arial, Helvetica,
I have the following homework question: Consider the following declarations and answer the question.

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.