~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Basically BASIC. ~ ~ Jonathan Rutherford. ~ ~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enough of the quiz program for now. I think everyone understands the BASICS (no pun intended) of it. [Why's it in capitals then - Neil] Lets take a look at strings now. A lot of people seem to be having a bit trouble with strings. Not so much the input or output of strings; more the manipulation [big word!] of them. Firstly, what is a string? Strings are variables that use the Dollar ($) sign at the end of them. Eg. A B C and would be variables that can hold numbers, but we added a $ sign at the end of them to make them A$, B$ and C$ they would also be able to hold alphabetical information. We could ask a person to input a number using this short program:- Print "Please enter a number" Input A This could then be converted to ask for a letter. Print "Please input a letter" Input A$ Strings can be more than 1 letter long, fro example we could have a string represting someone's name as NAME$ and ask this question Print "Please enter your name" Input NAME$ Print "Hello";NAME$ The good thing about using words for strings, are that they are easily understood. Eg. The contents of a string called A$, would be hard to guess, but a string marked COUNTRY$ would almost definately be holding the name of a country. There are a number of commands concerning the manipulation of strings, but the commands that I tend to use the most are Upper$, Left$ and STR$. Upper$ is useful as it converts any lower case characters into upper case characters. It is useful when comparing strings. Eg. You want the computer to ask for a word and if the word is "DOG"it will print "woof woof". As the computer is case specific, if you entered "dog" it wouldn't recognise it. However if the computer converted "dog" into "DOG" it would print "Woof Woof" Here how to use the command UPPER$. Print "Enter a word" Input DOG$ DOG$=Upper$(DOG$) If DOG$="DOG" then print "Woof Woof" You put the name of the string that you want to hold the upper case information, followed by an equal (=) sign; then the command "UPPER$" then open the brackets, put the name of the string holding the information inside the brackets and finally close the brackets. eg. The word "heLlO" is held inside a string called "WORD$". We want to put the word "HELLO" (all in upper case) inside a string called "UPPERWORD$". We would type:- UPPERWORD$ = Upper$ (WORD$) Left$ takes the leftmost character of a string and puts it ina different string. Eg. If you wanted to ask someone to give you a word and you would tell them the first letter of that word. Print "Give me a word" Input Word$ Letter$=Left$(Word$,1) Print "The first letter was";Letter$ The number inside the brackets after word$ is the number of letterS from the left you want to include. You could use left$ to make a simple typewriter effect:- For X=1 to 5 Print Left$(Hello,X) Wait 5 Next X So to use Left$ you must put the command Left$ ( Sourcestring , Number of letters ) eg. Print Left$ (A$,5) Would print the 5th letter from the left that was inside the string called A$. The other really useful string command I use is STR$. This is used for converting a number held in a variable like A or B, into a string. A$ or B$. As you can't add strings together numerically, ie. A$="4" : B$="5": Add A$,B$ You could add to variables together, then combine them into a string. A=4: B=5: C= A+B : Answer$=Str$(C) Hope you find the tips useful. Jonathan