Program That Will Generate A Pattern Using Do While / If Else Statements / Do Until Statements

Oct 11, 2009

Can someone give me a site to a tutorial that will help me write a program that will generate a pattern using do while, if else statements,and do until statements. I have been using google but I can't find anything. I need to generate patterns a certain size 6 by 6 or similar such as something like a checkerboard but where the ^ symbols is there a suppose to be a blank space..

View 3 Replies


ADVERTISEMENT

Write A Program That Will Generate A Pattern Using Do While, If Else Statements?

Apr 26, 2011

write a program that will generate a pattern using do while, if else statements,and do until statements. I have been using google but I can't find anything. I need to generate patterns a certain size 6 by 6 or similar such as something like a checkerboard but where the ^ symbols is there a suppose to be a blank space

*^*^*^*
^*^*^*^
*^*^*^*
^*^*^*^
*^*^*^*
^*^*^*^

View 3 Replies

Pattern - Lot Of Picture Boxes And If Statements - How To Use Arrays

Jan 17, 2012

I have found a major bug with this game Ive been working on for some time. The best way to make this game would of likely been by using an array. Problem is I dont know how to use arrays that well and I don't understand them. So I used a lot of picture boxes and If statements.

So here is the problem. When you click on the box its suppose to check to see if its a bomb or block. If its a block it busts the block, if its a bomb it will explode. Now here is the problem. Each block is not holding its own value or "block type" which determines if its a bomb or block. So when you click on a block and lets say it says its a bomb, the next block you click rather if its a bomb or not will explode. So its not checking the block value you click. instead its just grabing the last value generated. I will only show you short blocks of code because the code was written in a pattern form and it just repeats its self. If you post a reponse, remember im still newb and try to post samples/solutions using code ive given.

'Random Block Generator
Public Sub RandomBlockType()
Randomblock = New Random
SelectBlock = Randomblock.Next(1, 5)

[CODE]...

View 1 Replies

Get An Error Because The Sqlcommandbuilder Does Not Generate Statements In Multiple Tables?

Jan 26, 2012

I have 2 tables in MySQL database. These table were joined through a query and handled by a dataset. Im displaying these data through setting the dataset as the datasource of my datagridview. But when it comes to Update, Insert and Delete statements, I got an error because the sqlcommandbuilder does not generate statements in multiple tables.I want is, when I press the update button..all the changes made in the datagridview will be updated in the database. Can i make it without creating a datasource in design mode or through smart tag? If I have to manually create an UpdateCommand for adapters..Can I have a code snippet for that?

View 1 Replies

If Statements Inside If Statements?

Mar 14, 2012

I am trying to figure out how to do this:

if (phrase = hello) then
"say hello"
if (phrase = how are you?) then

[CODE]...

So basically, I want it to work like a timeline. If I say hello, then it will respond and move onto the next if statement. Get it?

Here is the code I have now:

If phrase.Result.Text = "hello" Then

synth.Speak("Hello to you too")

If phrase.Result.Text.Contains("How are you") Then

[CODE]...

View 21 Replies

Using Custom Sql Statements In Vb Program?

Jan 2, 2012

I am creating a windows program with VB and an Access database. I have a list view that displays on column in the database and I have that working due to the table adapters in VB. What I am trying to do is when the user clicks on an item in the list view, the program will query the database and put that info into text boxes. I am having the hardest time and can't seem to figure out how to use custom sql statements manually in
the program.

View 2 Replies

If Statements - Program Look At 2 Different Values Then Return A Value

Feb 18, 2012

What I need to do is to have my program look at 2 different values then return a value.

Here's an example:

If my tube material = SA-214 and the tube gauge = 20 then my tube wall thickness = .032. The thing is I have 5 different types of tube material and 12 different tube gauges so based on which tube material is selected and which tube gauge is selected the tube wall thickness will vary. So if I select a TM of SA214 and a TG of 14 then my tube wall will be .076.

View 3 Replies

Use Bind Variables In SQL Statements From Program To Oracle?

Nov 7, 2011

I am trying to use Bind Variables in my SQL statements which I pass to an Oracle database, but I get the Oracle error ORA-01008 Not all variables bound.[code]...

View 17 Replies

For And Next Statements?

Oct 18, 2011

I have to Create a Bowling Scores application that allows the user to enter 5 scores and then displays the high score and the low score and then clicking on the Statistics button there would be a label showing which is higher and lower. We HAVE TO USE FOR AND NEXT STATEMENTS.

View 7 Replies

If Statements With > 0 < 44?

Nov 5, 2011

How can i implement a statement with if for this number to be greater than 0 but less than 10? More Specifically where would the < 10 go?

Quote:
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

[code].....

View 12 Replies

Using 2 For Every Statements?

Dec 20, 2009

is there any way to use 2 for every.... statements?

i want to load up my.settings and 1 list will make new toolstripdropdownitem and the other lists is for the tooltiptexts

or I could do it another way, but how can I check the index of items in a my.setting string collection? like if I want to get the text of index number 3 how do I do that?

View 4 Replies

'if / Else Calculation Statements

Oct 6, 2010

I am using Microsoft Visual Studio 2008 with VB.NET, and in class we were assigned this project: A procedure should calculate a 2% price increase on all red shirts, but a 1% price increase on all other items. In addition to calculating the price increase, the procedure also should calculate the new price. You can use the variables strItemColr, strItem, decOrigPrice, decIncrease, and decNewPrice. Format the original price, price increase, and new price in the lblOriginal, lblIncrease, and lblNewPrice controls, respectively.

View 1 Replies

Cleaning Up If Statements?

Jul 20, 2010

Basically if i wanted my controls to be checked at startup id use a setting obviously

'UI Settings
chkCloseToTray.Checked = My.Settings.CloseToTray
chkAlwaysShowSystemTrayIcon.Checked = My.Settings.AlwaysShowTrayIcon

[code].....

View 3 Replies

Combine 2 Statements

Oct 31, 2011

how to combine this 2 statment..

IsConnected("Select * from manager_table", False)
Call Loader()
IsConnected("Select * from Clerk_table", False)
Call Loader()

i hve 2 listview, 2 table from accessdatabase..i put listview in tabcontrol..1 in tab 1 & second in tab 2...

View 1 Replies

Database - SQL IF Statements In VB?

Oct 24, 2011

I need to know if this particular block of code will work, and if not, what i need to do to make it work. I'm doing touchy business and i'd prefer to have it right the first time.

strsql = "IF COL_LENGTH('orders','nosign') IS NULL" & _
"BEGIN" & _
"ALTER TABLE orders" >& _
"ADD nosign bit;" & _
"END"

View 2 Replies

How To Make OR Statements

Sep 21, 2011

How do I make an OR Statement.

Im trying to do this

name3 = [name2].EndsWith("," Or "." Or "?" Or "!" Or ";" Or ":")

View 1 Replies

If Statements With Or Boolean Value?

Apr 13, 2012

I just wanted to know if it's possible to get an if statement to accept two strings into the same text box. An example of my code so far is below: (although please note that the program does not accept the strings after the "Or" boolean)

Private Sub btnpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpreview.Click
If cbox2.Checked Then

[code].....

View 5 Replies

Not Checking If Statements?

Jun 27, 2010

Okay I need two blocks of code for each of these:[code]Now both of these are under the if statements checking if the startsWith or equalsIgnoreCase check boxes are checked. (Only one is under the corresponding code not both.) At runtime when I check off the boxes neither of these two code blocks execute.

View 4 Replies

Pause Between If Statements?

Mar 17, 2011

Here is my code as I have it

Code:
Public Class Form1
Dim OpePro(7) As String

[code].....

View 8 Replies

Sql - Multiple If Statements, Then, Or Else?

May 3, 2011

I'm having some problems getting a query to run based off another query. Here's the database diagram to give a little background. The primary keys for all the tables are automatically generated by identites. The first 2 insert statements (Donation and Food_Donation) work but I can't get the last insert into Donation_Details to work. Here's the code so far:

View 2 Replies

Sql - Prepared Statements In .NET?

Sep 8, 2011

I cant really find any good sources for connecting to a database via connection string and executing prepared statements. Could someone show me an example or point me to a resource that might be useful?

View 2 Replies

Two If Statements - Why One Not Executing

Jun 27, 2012

I have two if statements and my project sees one and not the other. Here is the code:
If (IsPostBack) Then
HandleUploadedFile()
End If
Dim savePath As String = "Images "
If (fileUpload.HasFile) Then
[Code] .....
When I trace my code I find it goes to the second if and then go to end if without running the code inside the conditional.

View 2 Replies

Using IF Statements To Add Together Prices Using VB

Jan 29, 2012

I am trying to use if statements to add the prices of a cruises special packages together. I am using check boxes for the packages, so any, from none to all 3 are able to be checked. The packages available are VIP, excursion and restaurant. The price will also depend on the cruise length (7 or 10 day). I am wondering on which format to use, and if I even need to use if statements, how to make this statement true,

View 1 Replies

Using Like Statements For Strings

Nov 5, 2009

ok so i am in programming 1 and im trying to use a like statement for someone imputing a password and here is the details

-Changes all vowels to "X"
-Changes all numbers to "Z"
-Changes password to origonal form

i have tried but this is all i have

Dim vowelA As String
Dim vowelE As String
Dim vowelI As String

[Code]....

View 9 Replies

Using Multiplication In If And Then Statements?

Oct 5, 2009

I am very new VB .NET and just starting If statements. My problem is: Write an If statement that determines whether the variable CurrentBalance is greater then 1000.01. If it is, multiply the variable CurrentBalance by 1.005. Otherwise, multiply CurrentBalance by 1.007.So far I have

Sub Main()
Dim currentBalance As Boolean
System.Console.WriteLine("Enter Current Balance: " & currentBalance)
If CDbl(currentBalance) > 1000.01 Then

[code].....

I really don't even know if thats how I should be starting. Not sure what to put after the first Then on how to make it multiply currentBalance by 100.5.

View 5 Replies

2 SQL Statements The Same? Will They Produce The Same Results?

Aug 22, 2011

Are the following 2 SQL statements the same? Will they produce the same results?

sql1 = "SELECT * FROM [StudentDetials] WHERE ([Subject1] LIKE '" & Subject(0) & "' OR [Subject2] LIKE '" & Subject(0) & "') AND ([Day1] LIKE '" & TabDay & "' OR [Day2] LIKE '" & TabDay & "') AND ([Time1] >= '" & Time(0) & "' AND [ETime1] <= '" & Time(1) & "' OR [Time2] >= '" & Time(0) & "' AND [ETime2] <= '" & Time(1) & "')"

sql1 = "SELECT * FROM [StudentDetials] WHERE ([Subject1] LIKE '" & Subject(0) & "' AND [Day1] LIKE '" & TabDay & "' AND [Time1] >= '" & Time(0) & "' AND [ETime1] <= '" & Time(1) & "') OR ([Subject2] LIKE '" & Subject(0) & "' AND [Day2] LIKE '" & TabDay & "' AND [Time2] >= '" & Time(0) & "' AND [ETime2] <= '" & Time(1) & "')"

In my case they simply produce the same results but that's because of the data i'm using.

View 1 Replies

'Using' Statements And Disposing Method

Nov 9, 2009

I have a general query that I need clarifying by some intelligent boffins such as yourselves. I have the following code in a function:[code]Obviously the Dispose method will never be called on the site object or the helper object. This may be a stupid question but can I get an explanation as to how these objects actually get disposed of in memory? Is it just by the fact that the enclosing method they were created in has been disposed of?![code]

View 3 Replies

.net - VB Using Colons To Put Two Statements On Same Line?

Sep 11, 2009

Is it considered bad practice to use colons to put two statements on the same line?

View 9 Replies

Ado.net - Prepared Statements For ODBC ?

Jan 8, 2010

I just want to know how to create a prepared statement in VB. I know in java one would use ? and these would get replaced. I am aware that in VB you use @ParameterName. Basically my code gets down to where i use the prepare method and the error i get is that my syntax for my insert is incorrect. To me it seems that the parameter is not getting substituted in the insert statement

Eg.

Dim cmd As String = "insert into sites(id) values(@id)"
Dim odcmd As New OdbcCommand
odcmd.CommandText = cmd[code].......

View 1 Replies

Avoiding Multiple IF Statements?

Sep 14, 2010

I have the following code block. I'm tired of typing the same IF statement to check if the string has any lenght before assignning them to the class properties of Employee.

Is there any better to accomplish this?
Dim title = txtTitle.Text.Trim
Dim firstName = txtFirstName.Text.Trim

[code].....

View 6 Replies







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