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
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
Feb 6, 2012
trying to figure out how to declare items here. here is the
[Code]...
View 2 Replies
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
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
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
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
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
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
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
Apr 29, 2012
When and why do you declare variables in the Public Class Form1 section?
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
Jul 14, 2009
What are the different ways to send the emails using vb.net?
View 4 Replies
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
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
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
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
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
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
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