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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:17:57+00:00 2026-05-23T17:17:57+00:00

Is it in VB.NET possible to use variables without the need of use DIM?

  • 0

Is it in VB.NET possible to use variables without the need of use DIM?

now I have to use the variables like this:

dim a = 100
dim b = 50
dim c = a + b

I want to be able to use vars in this way:

a=100
b=50
c=a+b  'c contains 150

I think in VB6 and older VB this was possible, but I am not sure.

  • 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-23T17:17:57+00:00Added an answer on May 23, 2026 at 5:17 pm

    As far as what @Konrad said, he is correct. The answer, buried in all his caveat emptors, is the answer of “yes”, you can absolutely do this in VB.NET by declaring Option Explicit Off. That said, when you do a=1, the variable a is NOT an Integer – it is an Object type. So, you can’t then do c = a + b without compiler errors. You’ll need to also declare Option Strict Off. And at that point, you throw away all the benefits of a compiler. Don’t do it.

    As an alternative, with Option Infer On, Dim behaves the same as C#’s var keyword and gives you a lot of advantages if you’re trying to save on typing.

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

Sidebar

Related Questions

Is it possible to use this Role Provider AspNetWindowsTokenRoleProvider with ASP.NET FORMS Authentication (via
Is possible to use ArcSDE API in .NET(C#) ? http://edndoc.esri.com/arcsde/9.2/api/capi/dbconnects/dbconnects.htm Thanks
Is it possible to use a .net configuration file for a .NET console application?
Is it possible to use the ASP.Net Range validator when the format string is
Is it possible to use a .NET DLL in Delphi 2007 for Win32? I've
Is it possible to use the .NET configuration objects to get at .config files
Is it possible to use BackGroundWorker thread in ASP.NET 2.0 for the following scenario,
Is it possible to use SimpleModal (jquery plugin) with ASP.NET MVC? Since it has
Is it possible to use OData with Visual Studio 2005 and .NET framework 2.0
I wonder if is possible to use FTS with LINQ using .NET Framework 3.5.

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.