Date: Fri, 16 Sep 2005 16:41:49 -0500 (CDT) From: Mark Jacobson To: 810-030-01@uni.edu Subject: Ignore practice quiz questions NOT COVERED YET... Hi Visual Basic students, When I handed out the practice quiz, I included material and old quiz questions from several former semesters or summers that we have NOT covered yet in class. When you see a question on the old quiz practice quiz handout you received on Monday (or Wednesday) of this week, do NOT WORRY about it. ------------ We have NOT yet covered the Mid("Ghostbusters", 6, 3) function yet, which has 3 arguments. We have NOT yet covered FOR NEXT loops yet, which would be required, along with the Mid() function, to print a word or phrase vertically on the Form. P A N T H E R S <--------- Involves a For Next loop and the string function Mid() to get to each letter of the contents of the variable or textbox. Would you like to see the numbers one through ten on your form? Try this: For i = 1 to 10 Print i Next i Would you like to see Panthers printed vertically on your form? Try this: For i = 1 to 8 Print Mid("Panthers", i, 1) Next i Would you like to try another way to Print a phrase on your Form1 object, where it is whatever phrase you typed into a Textbox? Let us say the (Name) property for the TextBox object is txtPhrase. txtPhrase.Text might be: UNI Panthers beat Iowa Hawkeyes! For i = 1 to Len(txtPhrase.Text) Print Mid(txtPhrase.Text, i, 1) Next i Be sure to Maximize your running Visual Basic Form, if you have such a long phrase as: UNI Panthers beat Iowa Hawkeyes! 12345678901234567890123456789012 1 2 3 -- Len(txtPhrase.Text) would return the value 32 -- Len("Panthers") is 8 Len("Ghostbusters") would return the value 12, as would Len("UNI Panthers"). We have NOT yet covered the Len() function for Strings, or the Mid() function for Strings, or the For Next loop pattern for repeating a set of statements 4 or 8 or 12 or 32 or how ever many times we want to repeat them. So save those practice quiz questions for AFTER quiz one. They are probably going to be covered enough to be fair game for quiz two on Friday, September 30th. Quiz one is on Wednesday, September 21st. -------- ------------------------- Have a great weekend! If UNI does not beat Iowa, I hope that the following variable marginOfVictoryForIowa is the smallest for the entire 2005 season for the Iowa-UNI game. -------- ------ IF IowaTeamPoints > opponentTeamPoints THEN marginOfVictoryForIowa = IowaTeamPoints - opponentTeamPoints END IF And that Iowa wins the rest of its games this season after Saturday! And both Iowa and Iowa State win their bowl games. And that UNI wins the rest of its games this fall too, all of them! --- Notice the INDENTATION of the assignment statement in the above IF ... THEN statement... IF condition that is TRUE or FALSE THEN TWO WAY SELECTION what you want to do if it is TRUE ----------------- more statements... ... ELSE what you want to do if it is FALSE ... END IF How important is INDENTATION??? VERY IMPORTANT!!! Mark