Quick Basic And Visual Basic Flashcards
How do you join pieces of a PRINT command in QB?
To use multiple variables or strings in a command, put a semicolon between them.
How do you put the cursor in a specific spot in QB?
Use the LOCATE command and then x coordinate, y coordinate. Note: x and y are opposite from in math class.
Ex: LOCATE 10, 20 (10 down, 20 right)
Is LOCATE 0, 0 a valid command in QB?
No. Values cannot be 0.
How do you choose a background color in QB?
Add the background color after the text color with a comma.
Ex: COLOR 5, 15
How do you format a PRINT USING in QB?
PRINT USING “\ \ $###.##”; “Word”, 1.111
^ description of this as answer.
What are the rules for variable names?
Must start with a letter
No special characters or spaces
Cannot be a command
How do you use INPUT in QB?
INPUT “Question”; Variable, Variable2
^ description of this as answer.
How do you create a random number in QB or VB?
Use RND. To create between two numbers, use
INT(RND*(difference + 1) + min)
Use Randomize Timer near the beginning of the program for QB, and Randomize right in front of the command in VB.
How do you convert a number to a string?
STR()
How do you convert a string to a number?
VAL()
What is CHR()?
It returns the character associated with an ASCII code.
What is ASC()?
It returns the ASCII code associated with a character.
How do you find the length of a string?
LEN()
How do you change case of a string?
UCASE() or LCASE()
What does RIGHT(string, n) do?
Returns the rightmost n characters in string.