11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INSTRUCTOR NOTES 26SNIPPING STRINGS: LEFTS, MID$, RIGHTS, LENuIn this lesson the functions: ,,LEFT$ MID$ RIGHT$ LEN ^Jare demonstrated. The use of MID$( ) with three arguments is shown, but not that with ^the third argument omitted.These functions, together with the concatenation operation "+", allow complete freedom ^jto cut up strings and glue them back in any order.As in earlier explanations, the main characteristics of the functions are shown, but notall the special cases, especially those which lead to ERROR messages. It is better that ^extensive explanations not clutter up the text. If the student experiences difficulty, anexperienced programmer or an adult consulting the VIC manuals should clear upthe problem.^jQUESTIONS:1. If you want to save the "STAR" from "STARS AND STRIPES," what functionwill you use? What arguments?2. If you want to save "AND," what function and arguments?3. If you want to count the number of characters in the string PQ$, what function doyou use? What argument?^4. What is wrong with each of these lines?10A$=LEFT$(4,D$)10RIGHT$(R$,I)10F$=MID$(A.3)10J$=LEFT(R$,YT)KJ^5. What two arguments does the RIGHT$( ) function need?6. What command will snip the third and fourth letters out of a word?7. Write a short program which takes the word "COMPUTER" and makes it into"PUTERCOM".^146

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!