Variable Declaration Convert From C#
May 17, 2010
I'm working on a home project using DirectShow.Net. to learn some VB.net. Most of the examples I've found have all been in C# so I'm looking through code for ideas and converting where I need to. I keep stumbling upon these declarations and I'm unsure how to convert it to a VB.Net statement.[code]Then the second part seems to be assigning the value but as its made up of two parts im unsure how that works?
View 2 Replies
ADVERTISEMENT
Mar 8, 2010
In this
Dim [end] As Point = e.Location
what is the significance of the [] 's?
View 4 Replies
Jan 19, 2011
I have the following form[code]...
and when I run my app, I get a SQL error that tells me that I need to declare a value for '@payperiodstartdate' but I know that that value is declared because the first query runs fine. I am told that the line where the error is is line 59, which is this line [code]...
View 1 Replies
Feb 1, 2010
[code].....
View 4 Replies
Jan 27, 2012
wondering about the relatively efficiency of declaring oop variables in the loops, emselves, or declaring them before first use. Here are some examples:Declare early:
Dim ix As Integer
Dim currentNode As System.Xml.XmlNode
For ix = 1 To 100
[code].....
View 9 Replies
Oct 24, 2011
I have noticed in VB.Net that most Dim statements also include an assignment. Eg:Dim myvar As String = "Hello World"As this wasn't possible in VB6 I have always done the following:
Dim myvar As String
myvar = "Hello World"
View 3 Replies
Aug 26, 2011
For i As Integer = 1 To 10
Dim j As Integer = 10
Next
now my question is, Is memory allocated to j every time its executed inside for loop? or only value of 10 is assigned on subsequent iterations?
View 2 Replies
May 6, 2009
I want to convert this C# two dimensional array declaration: [code]But I got error message, "array initializer has too many dimensions", and there is a green jagged line below {1,2,3} in two dimensional array VB.net declaration.
View 9 Replies
Apr 23, 2012
Convert 2 dimensional array declaration from C#
View 1 Replies
Feb 20, 2012
im sure im mis-wording the concept but here it is anyways. I know in CSharp you can do
el.AppendChild(new UISize(file, "TSize") { CX = 95, CY = 20 });
which declares a temporary bucket variable and then assigns the associate property values to the variable. Which then sends it to the XMLElement AppendChild method. What is this design concept called? What is the conversion to VB.Net? I have tried using my own online utility that does a 90-95% conversion rate from C# <-> VB.Net. It has failed in this instance, and so need a hand-up on what i am looking to do to convert this from C# to VB.Net. I would really like to not have to do a long-declaration of a variable with assignments, if at all possible.
View 1 Replies
Apr 26, 2010
I'm making a call to my DLL file (prototyping 30+ functions), and want to be able to switch between different versions of the DLL quickly while in development. Thus, i want to replace the literal string constant that follows the "Lib" key word, with a variable string constant. In case there's any confusion in my use of the jargon. I am currently able to do this:
[Code]...
View 1 Replies
Nov 22, 2010
How could I create declaration(event) to a variable control in VB .net ? [code]please i need to know how to insert this (declaration) newweb_ DocumentCompleted it's similar to WebBrowser_DocumentCompleted but it's a variable
View 5 Replies
May 31, 2011
When I scroll down to the function shown below, and right click Analogues - go to definition it takes me to the top of the file, and lands on top of the
[Code]...
View 3 Replies
Jul 8, 2010
I was looking at some existing code and stumbled across a variable declaration I didn't understand.
public foo as Boolean?
What does the question mark signify?
View 2 Replies
Jan 4, 2011
I've been programming for many years in many languages and I've seen the variable declarations conventions change. With VS 2010 I've noticed you don't have to declare the variable type. I work alone so I can use any method I want. But, someday I may want to sell some of my code so I would like to keep my programming conventions current.
In VS 2010 which of these would be considered the best convention?
Dim srtFirstName = "Bob"
Dim strFirstName As String = "Bob"
Dim FirstName = "Bob"
Dim FirstName As String = "Bob"
View 5 Replies
Apr 21, 2010
Why are static variables set equal to 0 in the declaration when 0 would be the default value of the numeric variable anyway when it's first declared? Not including the "=0" in the static declaration seems to work with no problem.
View 2 Replies
Jun 21, 2011
I got problem regarding declaration of dynamic runtime array declaration Here is my code
[Code]...
View 5 Replies
Jun 21, 2010
Public Class Form1
Private Sub btnCompute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim percent As Double
[Code]....
Above is the code i have created. I am having issue with the variant "Percent" to display 37.50% instead of 37.5.
View 4 Replies
Jan 15, 2011
How do you convert a value of a numeric up down to a variable?
View 1 Replies
Mar 16, 2009
I have a variable (double) which has a constantly (infinitely) changing value. I would like to store all the values of this ONE variable into an array. My variable and array are:
Dim x as Double
Private y as Double() = New Double (499) {}
I tried doing this:
[code].....
View 19 Replies
Nov 9, 2009
sRndMessageNumber = "sNewMessage" & CInt(Int((3 - 1 + 1) * Rnd() + 1))
I want to Calculate a number between 1 to 3 and then call the variable sNewMessage2 for example. So how to convert from string to variable?
View 3 Replies
Nov 9, 2011
I'm programming a basic slot machine in Visual basic, and want to use a for loop to randomly choose the image for each slot, display the image in each slot, and change the slotName variable (so I can check later on which symbols are in the slots) for each slot. The problem I'm finding with a for loop is that the variables and objects for each slot have different names (slot1Name, slot2Name, slot3Name, lblSlot1, lblSlot2, lblSlot3, etc). Is there any way I could have could something like:
currentSlotName = "slot" & i & "Name"
This is the code at the moment, this code is repeated (with different variable and object names), for each of the 3 slots, which is pretty inefficient.
' Randomise numbers and assign images to slots based on random numbers, if the hold isn't on
' Slot 1
If Not held1 Then
slot1Value = Int(Rnd() * numbersGenerated + 0.5)
Select Case slot1Value
[Code] .....
View 1 Replies
Jul 5, 2010
Convert String Variable to an Integer?
I tried this[code]...
View 10 Replies
Feb 6, 2011
Here's my problem :
Let say I have a variable called A
Which value is 100 ( A = 100)
In a form, I have a textbox, where I want to enter a variable name
textbox1.text="A" for example
Then I want to display the value of that variable
msgbox (somefunction(textbox1.text)), which will popup 100
I read some info about Reflection, but they all seems to refer to controls and not simple variable
View 12 Replies
May 28, 2012
[Code]...
Now I'm wondering if it is possible to convert text to one variable defined up i.e.: dim mycolor as string
[Code]...
Is it possible to convert string mycolor to Color variable as defined before?
View 4 Replies
Dec 27, 2011
I am using the following function to Convert a String variable to a Date. Subtract a day from it and convert the date back to a String. The code goes as follows
[Code]...
If edate has a value 29/12/2011 than the value in expenddt gets changed to a different format and the value in expenddt comes to 12/29/2011 and later after subtracting a day expenddt is 12/28/2011 and than when i convert it back to a String i get the value in asd as "12/28/2012 12:00:00 AM"
[Code]...
View 2 Replies
Mar 9, 2012
Dim phone As New Regex("(?d{3}[) ]s?d{3}[- ]d{4}")
BUT I can't use it with txt1.text = phone as it isn't string.
How can I set new regex as string ?
View 11 Replies
Jun 12, 2009
I have a string value of form names in my DB so when my condition passes, the variable string will take over the value , then that value will call the form(variable) as string.
[code]...
View 3 Replies
Feb 6, 2010
I am developing an application which initially allows the user to browse and select a save location. The selected path is assigned to a public variable which is used with concatenation to crate folder for saving user input data. How can I change the path string to a constant so the user can run the program again without having to run setup routine unless they want to change the save location?
View 1 Replies
Nov 22, 2011
I am currently looking into the conversion of a string value to an integer. Obviously I will need to do some validation as to whether the passed value is in fact convertible to an integer.
At the heart of my question is this: the users' local is nl-BE (dutch (Belgium)), which means that we use a comma as decimal sign (and points as thousands separator); e.g. 123.456,78 would be a valid nl-BE number. Now, when using the numeric keypad, the
decimal key will yield a point, not a comma (weird huh!). So many user will enter 123456.12 and when converted to an Int, this should yield 123456.
The thing is that I want to cover all possible angles; both points and commas may be used as decimal sign by the users. So I wondering if anyone has written some code that deals with such a situation. I was thinking of an extension method that makes the
conversion based on whether a point or a comma is last used in the passed string (since no thousands separators should occur after the decimal sign).
View 5 Replies