Can Combine V & And Number To Manipulate Variable
Jun 9, 2011
I have 10 variables that have numbers at the end in sequential order (e.g. V1, V2, V3, ect.). I would like to perform a function to find what the position is in an array and then add then add the value to the correct variable. Can I combine V & and the number to manipulate the variable?
View 2 Replies
ADVERTISEMENT
Apr 6, 2009
Quote:
I have been working on a homework assignment and I am having problems with it. Okay here is my final code. I declare a variable that is not used yet. I am wondering if I need to use the index to somehow fix this issue with the consonants. Maybe I need to nest another if, then or do some kind of comparison to figure out if the word begins with a consonant then tell it to move the consonants to the end
'you know something like this below, but this is not my final code yet:
determine if origninalWord begins with a consonant
determine how many consonants there are before you reach the first vowel
If originalWord begins with 1 consonant
[CODE]...
But I do not know the proper way to code the begining in red color text the last two sections work for vowels and numbers. Here is my new code.
Code:
'Gail Amalfitano
'date modified: April 1,2,4,5,6 (date created 3/27/09)
'This program is for converting words or strings to pig latin. The user enters what they want converted,'hits the converter button and views the pig latin version of their entry.
Option Explicit On
Option Strict On
Option Infer Off
[CODE]...
Quote:
View 2 Replies
Oct 9, 2010
I have a number of tabpages that each contain a datagridview control only. Based on the results of a SQL statement I then loop through each tabpage and set its name. The reason for this is that at runtime (and depending on the results of the SQL statement), the contents of each tab page will change - henceI loop through the tabpages and set the name/ text (to reflect what will later be shown in the DataGridView)
The datagridview control on each tab has the default name e.g. DataGridView1, DataGridView2, DataGridView3 so it's easy for me to loop through them e.g.:
for i as integer = 1 to 3
[code].....
View 4 Replies
Oct 4, 2009
I'm trying to combine some text and a string value to reference a variable name.[code]
View 4 Replies
Jun 15, 2009
I'm looking for a way to take seven 2 digit numbers & combine them into one number to store in a database.The numbers represent hours for each day of the week & I only have one field to store them in. Then I need to be able to take the stored number & decode it back into the original seven numbers. Anyone have any clever ideas how I can do this?
View 6 Replies
Aug 18, 2009
I would like to know how I can have an enumeration that has multiple values and can be passed to a function.
Example:
Public
Enum
ActionEnum
NoAction = 0
[code]....
View 9 Replies
Mar 6, 2010
i have this variable Dim odddivider2 As Integer = CInt(20 6) and i want to expand the number 2 like a variable from 2 to 4.5 how i have to make that
View 14 Replies
May 26, 2009
I am trying to design a Function/Sub that will need to accept a variable number of parameters. Catch is that the parameters being passed are arrays themselves. As i understand it when you pass a variable number of arguments to a method, you pass them via an array. What im looking for is to make a method that would accept this form:
[Code]...
View 6 Replies
Nov 8, 2009
I am making a simple console game. If you have ever heard of the board game code breaker you will understand better.
In my version of the game you will have to figure out a four number combination. The only numbers it can be is 1, 2, 3, or 4.
I need to generate four random numbers and put each on into its own variable. This allows me to call back each number.
How do I do this? I have been doing some research on random numbers and I use this code to generate four random numbers
Dim rnd As New Random()
Console.WriteLine("20 random integers from -100 to 100:")
For ctr As Integer = 1 To 20
Console.Write("{0,6}", rnd.Next(-100, 101))
If ctr Mod 5 = 0 Then Console.WriteLine()
Next
Console.WriteLine()
But I can't figure out to put each number into a variable so I can call the same numbers back.
View 9 Replies
Sep 18, 2011
If i have a variable '12'
and a variable 'hello'
how can i double the '12' each time the variable is used?
What im trying to do is have a textbox which the user writes in a number, the number they enter then determines the amount of times a variable is written in a textbox.
so if the user were to put '3' into the textbox and click go, it would print hello12hello12hello12, how can i increase the number 12?
what i want it to do is look like this when the user presses go: hello12hello24hello36
View 1 Replies
Oct 16, 2011
How can I get a Variable's value set to the number of Data Fields in my DataBase that is NOT Nul.
I have in a table 10 fields or columns Named: Ing1, Ing2, Ing3, Ing4, Ing5, Ing6, Ing7, Ing8, Ing9 and Ing10. This fields will all most never all be fild, will be fild from 1 upwords. I need to know how many of them is NOT Nul.
View 5 Replies
Jan 12, 2010
I have a button that searches through a binary file to bring up customer information with the following code:
[Code]...
My problem is, I need to create a variable which holds the record number, so that the record can be edited, and put back into the file at its previous location, how would I implement this? Not sure about the code.
View 3 Replies
Jul 19, 2010
I'm developing an app that should allow the client to add several content sections to a page (in tabs). However I haven't found a way to easily create a form for editing the tabs.Assume for now that a tab just contains a title. I have a form that adds a tab, that's simple. But I also want a form that displays a text input for each tab and allows the titles to be edited and saved. I'm struggling with two main concepts:How to dynamically display the fields after grabbing the tab data from the database (each tab has its own row in the table).How to loop through the submitted data and update each tab in the database.How to select a particular text field from the number (e.g. given "1", how to select the element with ID "TabTitle_ 1".[code]I thought something like TabTitle[0] would be acceptable and allow for easy looping (as it does in PHP) but it's "not a valid identifier" apparently.It's very possible I have the approach completely on its head.
View 1 Replies
Apr 14, 2009
have code to generate a new random number as follows (which is 100% working and generating numbers between 0-9:
Dim randomNumber As Integer
Dim randomNumber1 As New Random
[code].....
View 3 Replies
Mar 14, 2012
as the title suggests i am trying to save a randomly generated number to a variable.I have done:
Dim randomposition As Integer
randomposition = Rnd(1, 1000)
when i do this it gives me this error:
[code].....
View 8 Replies
Mar 11, 2012
I have a dataset connection to an MS Access database. I want to use IN operator in WHERE clause like: WHERE DepartmentID IN (1,2,3)This means that all record with an ID of 1, 2 and 3 will be filtered. But the problem is I cannot create a parameter like:
[Code]...
View 1 Replies
Aug 10, 2009
I have a variable called VarNUM which stores a number from 1 to 10. What i want to do with this is based on the current number stored in that variable call a different set of variables from a module with Public Structure ITEM1. It has the same set of variables for ITEM1 - ITEM10 but with different values. So ya in raps how can i use the number in one variable to access a set of different variables? Something like ITEM(VarNUM) then the set of variables that all have same name but with different values so that i dont have to go,
Code:
if VarNUM = "1" then
name = ITEM1.name
store = ITEM1.store
[code]....
View 10 Replies
Aug 25, 2009
Variable 'RandomNumber' is used before it has been assigned a value. A new reference exception could result at runtime.
Sub RandomizeConLandLaunch(ByRef con As Integer)
Dim RandomNumber(,) As Integer
ConLandLaunch(con) = RandomNumber(1, 30000)
End Sub
what should i do ?
View 8 Replies
Jun 11, 2012
I want to query items from countries that are selected from a treeview (with checkboxes). However the number of countries that is selected by the user is not known beforehand. So how can I make a proper query when the number of OR operators is unknown? For example: SELECT DISTINCT Item FROM Countries WHERE Country LIKE @c1 OR @c2 OR @c3 etc� and then add the parameter values based on the selected countries in the treeview. I looked into parameter arrays but can�t make sense out of it really
View 13 Replies
Sep 25, 2009
I know this isn't a vb.net question per se, but I hoping that somebody else out there can shed some light on my problem. I have a query that looks like this:
" select count(*) from OBJECT_DESCRIPTION " & _
" where INSTALLATION_ID = @1 " & _
" and SHAPEFILE_ID = @2 " & _
" and SDS_REC_ID = @3 "
I assign the above query to the commandtext of an OracleCommand object. I'm getting the infamous oracle 'illegal variable name/number' error when trying to execute the following code using the above:
[Code]...
View 7 Replies
Mar 3, 2012
i am reviewing variabes, and just wondering any variables that can be used in math to hold a value this big =)
[Code]...
View 4 Replies
Nov 2, 2010
I have been searching the internet trying to understand in its simplist form why this behavior happens.
Dim mysingle As Single = 456.11 Dim mybool As Boolean = mysingle = 456.11
In the lines above mybool becomes false. I found this behavior when putting the single into a double I found extra digits showing. The .net documentations states a single is an approimate value I gatehr a single is a 32bit floating point number? But why are extra digits appearing when I have explicitly said what the number is.. surely the memory should store that numbers either side of my number are 0 to fill up the memory location?
View 3 Replies
May 17, 2011
I understand the concept of bytes and declaring variables to save on processing space. I understand that the max value that can be stored in a byte is 255. I cannot seem to wrap my head around my current issue. I don't have much experience working with byte manipulation.
[Code]...
View 3 Replies
Aug 17, 2011
I know that there is a way in which you can generate any random number between any range using the random variable. But my question is that is there any way to do the same thing but with letters?
View 1 Replies
Aug 19, 2009
I have hex strings that I would like to write a regular expression for. Here are some example strings.
[Code]...
View 3 Replies
Jan 16, 2009
I have got a decimal variable however i only want it to be to two decimal places. How can i set this?
View 4 Replies
Jul 19, 2011
Is there a way of testing to see if a number variable is an integer, or a decimal?
View 8 Replies
May 12, 2009
I have a windows form on which there is a textbox and a command button. When user inputs an integer in the textbox and clicks on the button, the userform grows and adds that many number of comboboxes and textboxes in a panel.
how to add variable number of comboboxes and textboxes at run time.
The maximum value of that integer would be 10.
View 2 Replies
Jul 24, 2011
I am using VB .net 2010 express from microsoft. I have a numeric up down box to display a variable that the user can choose a number for. Then I have a text box that I want to display a result of the updown box * 1.5... So far I have the following... What do I need or need to change? I have the integer variables initialized or whatever with Dim statements as follows -
'speed variables
Dim CruisingSpeed As Integer 'cruise speed - updown box
Dim FlankingSpeed As Integer 'Flanking speed - will be cruise * 1.5
[CODE]..................
It says that it cannot convert the up down box into an integer... I need it as an integer to calculate the other number...
Complete code just in case the above was not enough info...
'Imports Excel
'Imports System.IO
Public Class Form1
[CODE].............................
I have some stuff commented out because a variety of issues - some I will end up using and some I will end up taking out before it is done...
View 5 Replies
May 5, 2011
I'm trying to alter the existing number formatting in my company's application to make it more readable for international users. This is a stock trading application, so most stock prices come in with numbers precise to 2 decimal points, like so-> 17.23 We could also get ticks in that have precision out to 4 decimal points, so a penny stock might be 0.0341. The original string format that we were using for stocks was "#,##0.00##" Which would give us the format we wanted (essentially trimming '0's). The problem here is the ',' and '.' are forced onto the user, where in many other countries the thousands separator is '.' and the decimal point is ','. Boss man doesn't want to use "N4" for all numbers, even though this would resolve the globalization issue. Is it possible to have a globalized custom string format?
Other options besides writing some middle man code to internationalize numbers formatted the original way or another string.format method?
View 2 Replies