Different Ways To Declare Variables?

Aug 20, 2009

I'm new to VB.NET programming.What I'm confused about is the different ways one can declare a variable.Would someone please explain the difference between the two declarations below? [code]

View 2 Replies


ADVERTISEMENT

Ways To Declare/define Variables?

Feb 12, 2010

This is a VB.Net newbie question. I'm confused at the different ways to declare and define variables.Here's an example:

Dim URL As String = http://www.c-sharpcorner.com/default.asp
Dim request As HttpWebRequest = WebRequest.Create(URL)
Dim response As HttpWebResponse = request.GetResponse()

[code]......

View 1 Replies

How To Declare Variables?

Feb 6, 2012

trying to figure out how to declare items here. here is the

[Code]...

View 2 Replies

Declare Variables Dynamically?

Dec 10, 2009

Is it at all possible to declare variables dynamically? Something like Dim Answers & i As ArrayList. What I'm trying to achieve is putting one or more answers to a question into an array. Or should I really be looking at a mult-dimensional array to store the question number and answer? How would I add to and access a multi-dimentional array? Anyway, here's the section of code:[code].......

View 4 Replies

How To Declare Global Variables

Aug 16, 2010

How I can declare global variables in vb.net that I can access them in all windows of my application?

View 5 Replies

How To Declare Variables Properly

Jun 8, 2011

I am needing help in understanding how to declare variables properly. I am needing to write as program that calculates the commission for a sales person. I keep getting a error listed below. I thought I declared the salestextbox, costtextbox as integers correctly to use them in the calculation. I Copied my code below also. I have reread the chapter again and I am still lose.[code]

View 3 Replies

Declare Global Value Type Variables With New?

Dec 29, 2009

What happens if I do: Dim x As New Int32? Is a object of int placed on the heap? If it is, maybe your application would be able to access global variables faster if they were reference types.

A global variable as an value type should be somewhere at the bottom of the stack most of the time and it might take more time to get to this then to get a object from the heap. Unless it's the same story with the pointer of this object is also at the bottom of the stack of course.

View 9 Replies

How To Declare Variables To Make It Work

Feb 13, 2012

I am making a game that involves moving picture boxes automaticly i can get the boxes moving but I need them to be object orientated but when I try to make it a class i am not to sure how to declare the veriables to make it work. [code]

View 3 Replies

Create An Isolated Context Which Allows Declare Two Variables

Nov 29, 2011

I put "isolated context" in quotes because I don't know what else you would call it. Basically, in C#, you can do this:

{ int i = 0; }
{ int i = 1; }

The curly braces create an isolated context which allows you to declare two variables with the same name in the same method or property logic. Is this possible in VB.NET? Also, what do you call this aside from an isolated context?

View 1 Replies

Declare Some Global Variables For Use In Various Subs/functions?

Oct 21, 2011

At the head of a module, I wish to declare some global variables for use in various subs/functions.

What is the difference between.Dim x as string and Private x as string / Public x as string, and when would I use one over the other?

View 1 Replies

Declare Variables In Public Class Form1?

Apr 29, 2012

When and why do you declare variables in the Public Class Form1 section?

View 1 Replies

Declare Public Variables, Constants, Functions In A Proper Way?

Jan 13, 2011

I'd like to get a more refined programming style and I was wondering if any of you might give me a hand...(How to declare public variables, constants, functions...in a proper way),is there any useful link or pdf document I could have a look in order to improve my style?

View 5 Replies

Declare Variables For The Average Score And The Letter Grade?

Apr 18, 2011

I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows: In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.

Create a subprocedure for the Click event for the btnDisplay button. It should call the CalculateGrade function with three arguments (the three test scores from the text boxes), and display the returned value in the lblGrade box.I have looked all over the internet and have had no luck finding an example to look at I am taking an online class and I am having trouble getting my solution to work. My assignment is as follows:

In the function, declare variables for the average score and the letter grade. Calculate the average, use If/ElseIf statements to determine the letter grade, and return the letter grade.

[Code]...

View 7 Replies

Declare Two Module Level String Variables Name StrCaptital And StrChoice

May 16, 2011

What I'm supposed to do is declare two module level String variables name strCaptital and strChoice and I did that. At least I think I put them in the right place, however what I'm not sure what to do is and I started is that I'm supposed to code each state radio button's click event procedures so that each assigns the appropriate capital to the strCapital variable and then each removes the contents of the lblMsg control.url...

View 3 Replies

VS 2008 Declare Variables Inside Each Event Handler / Program Runs

Mar 29, 2010

I am teaching myself VB, and when I try to run this program, I am getting "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object." If I was to declare the variables inside each event handler, the program runs, but why won't it run when I make the scope public? Seems repititous having to declare the variables in every event handler. [code]

View 7 Replies

Declare Store And Access "global" Variables?

Jan 17, 2011

I have an application that I'm writing and I'm trying to declare two variables from my sql server, store the values and pass them to my forms.[code]...

View 5 Replies

.net - C#: Different Ways To Run Code Asynchronously?

Feb 14, 2011

I have this code List<string> myList = new List<string>();

myList.AddRange(new MyClass1().Load());
myList.AddRange(new MyClass2().Load());
myList.AddRange(new MyClass3().Load());
myList.DoSomethingWithValues();

What's the best way of running an arbitrary number of Load() methods asynchronously and then ensuring DoSomethingWithValues() runs when all asynchronous threads have completed (of course without incrementing a variable every time a callback happens and waiting for == 3)

View 4 Replies

Chat System With One Or Two Ways?

Jan 15, 2010

I'm trying con build a simple chat client/software (whole in on executable) wich start listen from the start on the port 5900 and when a client connect to that port the chat is established.

The problem is that only the client can chat to the server, the server cannot answer the client because the connection is working in one way.The i've tried to connect from "server" to the client when it establishes a connection but the system crash warning me that the port is already on use.

[Code]...

View 1 Replies

Delete A File In Many Different Ways?

Nov 14, 2011

What is the difference between these ways to delete a file.Is one of the methods better than the other?Are there other ways to delete a file (. Net 4)

System.IO.File.Delete(path
to file)

My.Computer.FileSystem.DeleteFile(path to file)

View 3 Replies

Different Ways For Playing Audio (MP3)?

Jan 28, 2009

I'm new to VB and have over the last week or two been looking at the different ways to play audio (mp3's). Windows Media Player, Microsoft Multimedia Control, Bass.dll, SndPlaySound, MCI SendString and DirectX (including audiovideoplayback, direct3d and directsound.) I originally decided to use windows mediaplayer, mainly because it seemed the logical choice but quickly found out I couldn't get it to work properly.

So I installed the Directx SDK but now I'm completely overwhelmed about what to use and why. I need to be able run the compiled code on a win 2k box, play an mp3 from start to finish then load and play another mp3 from start to finish and so on. Whats the difference between the varied choices and which would be the best for me to use?

View 5 Replies

Different Ways To Create Object

Jun 13, 2011

I want to know by how many different ways I can create an object. The most common usage I am aware about is:
Dim obj as ClassA = new ClassA().

View 1 Replies

Different Ways To Play Audio?

Dec 10, 2009

I'm new to VB and have over the last week or two been looking at the different ways to play audio (mp3's). Windows Media Player, Microsoft Multimedia Control, Bass.dll, SndPlaySound, MCI SendString and DirectX (including audiovideoplayback, direct3d and directsound.)I origninally decided to use windows mediaplayer, mainly because it seemed the logical choice but quickly found out i couldn't get it to work properly. So i installed the Directx SDK but now i'm completely overwhelmed about what to use and why.

View 3 Replies

Different Ways To Sending Emails Using .net?

Jul 14, 2009

What are the different ways to send the emails using vb.net?

View 4 Replies

Ways To Play Audio?

May 4, 2010

I'm looking at creating an mp3 player to keep myself busy. However I'm trying everything I can to avoid using the windows media player COM component. It makes it a little too easyWhile looking around I stumbled upon the DirectX.AudioVideoPlayback namespace and I was wondering if this would be sufficient. Would I be able to create an equalizer and other more advanced things for my application?

View 2 Replies

Ways To Play Mp3s

Jun 20, 2012

Just found out the hardway that there is no longer support for Direcshow for VB.net and C#. Does anyone know other ways of playing mp3s in VB.net, or even video for that matter?

View 9 Replies

Better Ways For Reading And Writing To .txt Files?

Jun 29, 2006

I am trying to create a bunch of records, there will be a limited number of "Codes", about 50. Each "Code" is associated with a name from a textbox, I was trying to have it save each one when you click a button, to a .txt file.So, from the start the record will be blank, the person will go through the form, choose a number from a numerical up and down box, pick a name associated with it (both of these are mandatory and not implied). When they click the button, it will save the contents I talked about into a .txt file, say the number is #2, and the name is "Bob", the next time they try to change that value for #2, it will overwrite "Bob".

View 6 Replies

Compare Ways To Instantiate A DataTable?

Feb 17, 2012

Presuming "instantiate" is the appropriate terminology, may I get some insight as to which of these are better, more efficient,[code]...

View 3 Replies

Different Ways To Test DBNull From Dataset

Oct 6, 2009

Im using VB in VS 2005.I have found several methods of testing if a value from a dataset is null. Are there differences between these two ways of doing it:

[code...]

Is one faster than the other? From some searching online, there seems to be debate about the best way to handle null values.

View 1 Replies

How To Setup MyClass To Work Both Ways

May 7, 2010

I'm using VS 2010 so I have auto-implemented properties.I have a class and I want to access the properties by a string.[code]But, I also want to be able to access the variables something like this way.[code]How can I setup MyClass to work both ways?

View 7 Replies

VS 2010 - Best Ways To Store Values?

Oct 11, 2009

I want to store say like 8 values, that in the end will be combined into one string. What's the best way to store them? They should be reached in a own namespace I did. In a separate .vb file. I want to able to edit them. The values are both text and numbers. So whats the best way according to you?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved