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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:11:21+00:00 2026-06-18T05:11:21+00:00

there is the option to do this in vb.net Dim a, b, c As

  • 0

there is the option to do this in vb.net

Dim a, b, c As Single, x, y As Double, i As Integer

also you can do

Dim myString = String.empty

Is there a way to initialize and assign multiple variables like the first example but using the assignment as the second one?

  • 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-18T05:11:22+00:00Added an answer on June 18, 2026 at 5:11 am

    I tested it in VS 2008, but I don’t think that the Syntax of the Dim statement changed since. You will have to specify the type for each variable, if you initialize them

    Dim a As Single = 1, b As Single = 2, x As Double = 5.5, y As Double = 7.5
    

    Or you can let VB infer the type and use type characters (here ! for Single):

    Dim a = 1!, b = 2!, c = 3!, x = 5.5, y = 7.5, i = 100
    

    By hovering with the cursor over the variables in VS you will see that the types are inferred correctly as Single, Double and Integer.
    You could also use F for single. See: Constant and Literal Data Types (Visual Basic)

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

Sidebar

Related Questions

I'm trying to call this code in VB.NET with option strict on: Dim application
How does Branchout custom their Request Dialog messages? There is no option for this.
I tried to accomplish this via a MailMessage.Headers.Set call, in VB.net. See below: Dim
Is there an option for VB.Net in Visual Studio to directly jump to variable
Is there a standard way for .NET class loaders to work? Say I compile
Is there a way to query mongodb in such a way that I can
The following compiles in VB.NET (with Option Strict On) and outputs False : Dim
I can't seem to understand how it works. I see there is an option
There are nice SO question and answers about this issue, but these options didn't
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments

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.