A month can be a long time in the microcomputer field, and June has been a classic example. We welcome two new members to the fold - GRAHAM DIACON from Nitney, and JESUS ANONUEVO from Kidlington - and there may be one or two more before this month is out. Mrs Roberts (Bulletin Board last issue) sold her system within a few days to one of Jesus' colleagues and we now have a small nest of 99ers working in close proximity in the Oxford Hospitals. There are plans afoot to try and get together during work time, and any such meetings will be reported in this newsletter. If anybody else fancies getting together I will help all I can, although I may not always be free to attend such meetings outside working hours.
Anybody who was still awake and knew what to look for on Thursday, June l5th., and who also happened to be watching Central's DATABASE program at ll p.m., would have seen a report on ROMOX and their imminent appearance in shops with automatic soft- ware dispensers. Those who already knew a year ago about this venture and who also knew that the TI-99/4A features on the list of micros which will be catered for by ROMOX, might just have been alert enough to see that the magic lettering TI-99/4 headed the list when a screen menu appeared for a fleeting moment during a demo. That probably means that I'm the only one who saw it...
It seems that a company called J & KH SOFTWARE has just brought out SXB (Super Extended BASIC) for the 4A - this may be the Extended BASIC which I have been told about recently, and I will keep you informed of its whereabouts as soon as I know.
ALAN DAVEY, one of my many contacts, is in the process of setting up a BULLETIN BOARD so that network buffs with the right equipment can log into his 4A. He has a MINOR MIRACLE3 MODEM if that helps anyone, and I will be handling enquiries for him for a while. MICHAEL SAYERS, secretary of the DERBY USER GROUP and now in receipt of a complimentary subscription to TI-LINES, is also interested in networking; he has (or is in the process of building) a MAPLIN MODEM, so if anyone wants to get involved in helping micro to talk to micro then contact me in the first instance.
Readers of the monthly PERSONAL COMPUTING TODAY will have already noted the result of their READER SURVEY. Fully 12 per cent of them are 4A owners, which, considering their lack of TI programs, is more than a little surprising. However, PCT are typically pessimistic about the continued existence of the 4A, which is likely to lose them some of their 12% and gain them a few irate letters.
The next issue, due out August lst or thereabouts, may be a little late due to my succumbing to a desire to have a short holiday. Part of the time will be spent in London visiting PAUL DICKS, who sparked off the UK User groups. You could say that he is to the User groups what Sir Clive Sinclair is to Computing - except that he hasn't made GBP 9 million out of it...
You will find a couple of sheets of paper included with this issue. Both give some brief details about TI books; one for STEPHEN SHAW, and one for ahem myself. If you are averse to receiving such unsolicited material please let me know and it won't happen again. It might occasionally be of some benefit to you, you never know.
STOP PRESS: TI-LINES is now sent to Holland to two knowledgeable friends of mine; PAUL KARIS (former president of the Netherlands User Group and author of a number of articles on ENHANCED BASIC) and BILL van KERKOERLE (author of a regular column in the User group‘s newsletter, TIJDINGEN, and he also used to translate each one into English and send them to me for publication in the late TIDINGS).
As I said earlier, June has been a busy month, and at the time of writing (16th.) it looks set to be a busy summer. In July/August I will be launching my own entry into the third-party software jungle with a company called QUINSOFT. First products will include a suite of programs to decode, modify, and re-encode speech data using either Extended BASIC or the Speech Editor (and the Speech Synthesizer). (web note- no software was seen) Readers of TI-LINES will shortly know how it is all done when the series on the synthesizer begins (THE SPEECH SYNTHESIZER - HOW HE IS spoke).
You will see later that our happye thronge is quite a large one - 24 members - but the size is misleading. About 50% is made up of complimentary subscriptions which I pay for, and Associate members (who live outside Oxfordshire completely) account for 10% - and we have a recent member joining in that capacity: PAUL DUNDERDALE, who runs PiKaDee Software, and who has kindly offered to send fliers about OTIU out with his software. I will be sending him something shortly.
That's about it for this month's editorial. I hope that what follows is of some
interest to you, and that in the coming months you will gain the confidence to add
your own thoughts to my brain dumps.
Send in any High Scores you have reached on any module (not cassette) with your name,
module, and difficulty level (if any). If yours is higher than any others which have
been sent in,it will be printed here. I will start the list off with three scores
of mine (which aren't very good, so send in yours and make the target higher).
PARSEC 1774OO DAVID BROWN
TI INVADERS (Downright Nasty) 24493 DAVID BROWN
MUNCHMAN 18457O DAVID BROWN
Send in ANY high scores - don't just send in for the three above.
Send me any programs that you have written (don't worry about their length). If they are good and original they'll be printed.
Send in your hints, tips, views, - anything you like (providing it's printable!). Don't be afraid to come forward - send in anything you like. If you decide to send in a program, and the listing is less than 50 lines, please send me a decently-typed (preferably computer-printed) copy. If it is more than 50 lines, try to send it on cassette (which I will return). This way fewer bugs are likely to creep in through me being unable to read someone's handwriting!
Whichever way you send it, DON'T FORGET: please include your name and address, and if you have one, a telephone number. This way I can contact you if necessary - I won't print your address and phone number if you don't want me to.
Just to start things off, here is a listing of a routine of mine. It runs in Extended Basic and moves a sprite around the screen using the following keys.
That's about it for now. I hope that next issue we'll have a few contributions,
1 REM SPRITE CONTROL IN EXTENDED
2 REM BY DAVID BROWN
100 CALL SPRITE(#1,43,16,10,150,
110 CALL SCREEN(2):: CALL CLEAR
:: CALL MAGNIFY(2)
120 CALL KEY(0,K,S)
130 IF S=-1 THEN 120
140 IF S=0 THEN CALL MOTION(#1,0
150 IF K<49 OR K>51 THEN 170 ELS
160 CALL MOTION(#1,0,(K-50)*11)
170 IF K<73 OR K>75 THEN 120
180 CALL MOTION(#1,(K-74)*11,0)
190 GOTO 120
P.S. If you can think of a decent name for this section, please send it in!
In the last issue, we looked briefly at the IMMEDIATE mode; LET; VARIABLES - STRING and NUMERIC; PRINT and PRINT SEPARATORS - and the use of PRINT ::::: to scroll the screen contents; LINE NUMBERS and STATEMENTS; LIST; RUN; and the use of RES(EQUENCE).
Before continuing, I think that it might be a good idea to depart from BASIC for a while, to look at the functions on the keyboard - like EDITING - so that we clear up any blind spots which you may have had (or we can hopefully avoid any in the future as we progress to other functions).
Almost immediately we run into difficulties (at least, I do). There are at least three different models of the TI at large in the UK, not to mention the different versions of each model. However, I haven't seen any questionnaire yet returned with anything other than a PAL 99/4A given as the micro.
The three models I have encountered are:
l) The early NTSC 99/4 - one of which I have - which produces American TV signals and needs a specially-adapted monitor in order to work. It has one or two facilities which other 99s lack, and until recently I thought that these were of only minor importance. However, the lack of a lower- case character set means that many programs written for a 99/4A will not work properly on the 99/4as (there are two models), and in return, soft- ware written to take advantage of the fact that the NTSC 99/4 can both read and write data on CS2 will crash if run on any PAL 99s.
2) The later, slightly modified, PAL 99/4, which uses an external modulator to enable the use of domestic TVs.
3) The PAL 99/4A, which I also have, and which continues the compatibility with UK TVs, and also adds some extra keys to a greatly-modified keyboard. The principal difference is, of course, the keyboard. Although it is a definite improvement on the calculator-style unit of the 99/4s, it is still non-standard with a number of odd and sometimes irritating key- strokes being necessary to obtain, for example, the question mark, or the quotation mark.
There are other differences - there is an automatic repeat on 4A keys, and the SHIFT keys have no keycode as they do on the 99/4s.
There is one other model which you are unlikely to see, and that is the NTSC 99/4A.
The simple editing functions allow you to move left or right over (without deleting) a line or lines, to erase the whole line (which could mean up to 4 or more screen lines), to delete or insert characters one at a time in an existing line. These functions are available in both IMMEDIATE and RUN modes.
Slightly different functions like FCTN E or FCTN X can also be used in both modes: they do however have different effects depending upon the circumstances in which they are used. For example, while executing an INPUT instruction or while typing instructions in the IMMEDIATE mode, these two 'up' and 'down' keys can substitute for 'ENTER'.
If you have a program already in memory, then typing an existing line number and pressing FCTN X or FCTN E will call that statement onto the screen, and it can be edited. (Typing 'EDIT' and the line number has the same effect). However, typing an existing line number and pressing 'ENTER' will delete that statement from the program.
Having brought a statement onto the screen with the FCTN key, if you then press FCTN E or FCTN X any statement lying before or after the current one will be called onto the display ready for editing. To get out of this 'EDITING' mode either 'ENTER' or FCTN Q will need to be pressed.
Here, for your information, are the equivalent editing keys on both 4s and 4As:
On the 99/4s there is a standard overlay which contains details of the editing
keys, while on the 4As there is a strip which is inserted in the guides which lie
above the top line of keys.
KEY 99/4 99/4A Effect
CLEAR/BREAK Shift C FCTN Q Ignore entry/Interrupt program
DELETE . . . Shift F FCTN 1 Delete character lying under cursor
INSERT . . . Shift G FCTN 2 Insert at character lying under cursor
ERASE . . . Shift T FCTN 3 Delete entire statement
LEFT ARROW Shift S FCTN S Move to the left over the line
RIGHT ARROW Shift D FCTN D Move to the right over the line
UP ARROW Shift E FCTN E Enter statement and move to lower line number if editing
DOWN ARROW Shift X FCTN X Enter statement and move to higher line number if editing
To try and demonstrate all of the main editing functions (except ENTER and its alter egos), switch on your machine and select TI BASIC. As usual, if anything is to be entered at the keyboard it will appear 'indented' on these pages; you there- for type in the line from the page, check it, and then press ENTER unless told otherwise.
Because we are going to be using the editing functions, you will need a way of distinguishing between data to be typed in, and instructions about which editing keys to press. What I will do is to use a double oblique (//) to separate data from editing keys, and hope that no confusion arises.
Until further notice, therefore, do not press ENTER after typing in each line;
follow the instructions which occur after the '//' instead. Make sure that the
dreaded Alphalock key is pressed down.
This shows the ERASE function at work.
FOR EXAMPLE // FCTN 3
Extend the line by typing in whatever takes
your fancy, so that it occupies at least four screen lines, and then use FCTN 3 and
note what happens.
MOTHER // Use FCTN S until the cursor is as far left as it will go, then press FCTN 2.
PRINT "HELLO // Follow "HELLO with a space.
The line should now look like this:
The line should now read PRINT "HELLO MOTHER.
Now press FCTN D until the cursor lies to the right of the R in MOTHER.
" : "HELLO SON" ::::: // Now use FCTN S to move to the left until the cursor lies over the first colon ( : ) after SON". Press FCTN 1 until all the colons have been deleted.
PRINT "HELLO MOTHER" : "HELLO SON"
(You can now revert to pressing ENTER at the end of each indented line).
This has shown in a very simple way the effects of INSERT, DELETE, LEFT, RIGHT, and ERASE. Now press FCTN 4 and notice that the line moves up the screen but is not executed - the computer has ignored the instruction. You can fill the screen with text in this way, none of which will be acted upon by the computer - should you feel so inclined.
The CLEAR/BREAK function is quite useful as you will find later when you come to edit long statements; if you decide to leave the statement as it is (having made some changes to it), you don't have to retype it. Just press FCTN Q and you will exit from the EDIT mode and leave the statement untouched internally.
Right, back to BASIC.
So far we have looked at ways of storing and retrieving data, and of getting the computer to do it automatically if we store the necessary instructions (write a program). Remember that the PRINT command doesn't alter the contents of the variables that it places on the screen - it just copies them out.
There is a parallel command called DISPLAY, which is a limited form of PRINT; DISPLAY can only put information on the screen, while PRINT can be added to, allowing it to 'print' information not only to the screen, but also to cassette, disk, printer, speech synthesizer, Mini-memory, and so on.
The way that PRINT is implemented on the 99s makes the screen behave like a 'glass teletype' - that is, you can't type over information already placed on the screen, and the printing always begins on the 24th line, scrolling up any current information, line by line, as the bottom line is filled. There are ways round this (equivalent to the PRINT AT command found on other machines), and we will look at them later in the series.
PRINT is not restricted to printing out the contents of string and numeric variables;
it can print the solution to a calculation, whether using numeric variables or
and so on.
PRINT 2 / 3 + 4 / 5
A = 12.3
B = 32.1
PRINT A / B + A - B + 7
In the example program which was given last issue, the variables were assigned values (numbers or words were stored in them) actually in the program.
Using that system, if you wanted to use different numbers or words, you'd need to have as many programs as you had variations in the numbers or words. This is not, you'll agree, a very convenient way of doing things.
This is where INPUT comes in. INPUT tells the computer that it must stop and wait while data is typed and then ENTER, FCTN X, or FCTN E is pressed before it can continue with a program. When the computer stops and waits for an entry, it behaves a little like it does in the Immediate mode: the cursor appears, flashing on and off, you have around four screen lines in which to type your data, and the editing keys allow you to alter what you have typed, should you make a mistake.
In this case, FCTN 4 functions as an 'interrupt' - it stops the program and returns the computer to Immediate mode, as well as causing a message to be printed on the screen, which says BREAKPOINT AT nnn where 'nnn' is a statement or line number.
When you use INPUT in a program, you can specify which variable is to receive the data which will be typed in. If you used A$ - i.e., INPUT A$ - then once you'd typed your entry and then pressed either ENTER, FCTN X, or FCTN E, the computer would take whatever you'd typed and store it in A$.
It would then go onto whatever statement followed. If you type nothing, or if you erase anything that you have typed, and then enter it (it sounds a bit daft), then a 'null string' will be stored in A$.
Later, we will look at how this can be of use in a program. There are one or two things to watch out for: if you want to use any quotes (") in your entry, you must make sure that they are in pairs. Typing "EERT and then pressing ENTER will cause an error (one which results in a WARNING message); you would need to type "EERT" for it to be acceptable. If you need to use a comma, then you are forced to begin the entry with a quote and end it with one: the reason for this is that the comma has a special function during INPUT which we will come to in a moment. To enter 29, Kestrel Crescent you would actually type "29, Kestrel Crescent".
It is possible to enter several different items of data during an INPUT and have each assigned to (stored in) a different variable. Thus INPUT A$,B$,C$ will split the data entered into three parts and store the first in A$, the second in B$, and so on. How does it know which parts go into which variable ? The answer lies with the comma. If a comma appears in the data which you type during an INPUT, the computer takes the segment which lies before the comma and assigns it to the first variable, and anything after the comma but before any other commas is stored in the second variable, and so on. INPUT FORENAME$, SURNAME$ will take data of the form PETER, BROOKS and assign PETER to FORENAME$, and BROOKS to SURNAME$.
Using INPUT like that can save a little space by replacing several INPUTs with just one.
So far we've looked a little at the entry of 'strings' (words, phrases, etc.); when it comes to numbers the rules are a little different. If the computer came across the command INPUT N in a program, it would stop, as usual, and wait for you to make an entry and to press ENTER or one of the other entry keys. However, if you make no entry and simply press ENTER, the computer will not accept it and will come back with an error message and will present the INPUT again. Where the entry of numbers is concerned, the computer needs something to be typed (and it is fussy over just what you can type) before it will carry on.
There is the same caution to be exercised with commas as discussed above, and there is the added restriction that only certain keys may be pressed, and in a certain order. Those keys are: full stop (.), +, -, the digits O to 9 inclusive and E. The E stands for 'times 10 to the power of' and is used in what is known as Scientific Notation. For the moment this need not concern you, but we will look into it later in the series.
Valid entries are: 15 -20.87 +.6 -.00 1.23 1E6 -2E3 -4E-17 2.3E-65
Unacceptable entries might be: -1-1 ..23 1.2. EQ.5 EE.-9 and so on. The TI manual gives full details.
On many other machines you can enter numeric variables and expressions and the system will evaluate them and assign the results as usual. However, the 99s cannot, which on occasion can make translation of one program for another machine into TI BASIC rather difficult.
INPUT is actually a very powerful function, and it has other properties which we will look at in more detail. At a simple level, then, let us write a short routine to work out the RECIPROCAL of any number (that means the result of dividing l by the number).
what will we need ? Well, obviously an INPUT statement first, to obtain the number and assign it to a numeric variable. Then we'd need to calculate the reciprocal by dividing 1 by the variable, and then print out the result. As we can get PRINT to perform the calculation and print the result, we can combine the last two steps into one statement. Let's use the variable name N:
1 INPUT N
when the cursor appears (along with a tone and a question mark), type 1000 and
press ENTER. The computer will respond with .00l and DONE . It can get a bit
boring having to type RUN every time you want the program to be executed, so let us
introduce a useful (and much-maligned) command: GOTO (or GO TO, which is also
allowed on the TI). This command can be used to tell the computer to 'go to' a
particular statement (line number) and continue processing from there. To save us
having to type RUN every time, then, we can get the program to go to statement l
once it has executed statement 2. Add this statement:
2 PRINT 1 / N
This will keep the program running for ever (unless we make a spectacular mistake)
until FCTN Q (BREAK) is pressed.
3 GOTO 1
Type RUN and try it a few times.
Now, if you are the curious type, you may have wondered why a question mark appears
when the INPUT is executed. This is called a 'prompt' and is provided free of
charge by the computer (helpful isn't it ?) to remind you that you are to enter some
data. The prompt, however, can be very helpful indeed, especially if it can be made
to give some indication of what you are supposed to be entering -like whether
there are several items to be separated by commas, for example. In fact, it can
be so expanded. Retype statement 1 thus:
1 INPUT "ENTER A NUMBER" : N
Note that a colon must be present between the prompt and the variable to which the entry will be assigned. The prompt can be another variable, but it must be in 'string' format, which we will cover later in the series when we look at STR$().
This time the computer prompts you in more detail, although you may find that the cursor lies a little too close to the prompt for comfort - you might need to enter a 'space' at the end of the prompt string to spread things out a little. Try entering a few numbers to see how the computer reacts, and throw in a few incorrect entries to see what happens.
As an example of how a programmer might use such prompts to make a program more
'friendly', try this short program:
when you run this short routine, notice how stupid the computer is: it can't tell
if you enter somebody else's name, or if you lie about your age. This is a small
example of how computers are only as intelligent (and as capable of taking over the
world) as their programmers are.
1 INPUT "PLEASE ENTER YOUR FIRST NAME " : N$
2 PRINT "THANK YOU, " ; N$
3 INPUT "NOW PLEASE ENTER YOUR AGE IN YEARS" : Y
4 PRINT "THANK YOU, "; N$; " NOW I KNOW WHO YOU ARE AND HOW OLD YOU ARE"
The last routine doesn't make any use of Y, the age variable. Use your imagination to write some more lines to make the computer respond with "YOU ARE";Y;"YEARS OLD", or to print "HELLO, 31 YEAR OLD KERMIT" if you enter 31 and KERMIT during INPUTs.
Where would you place a GOTO instruction to make the program continually loop back to line 1 ? Try it and see if you have understood the use of the instruction.
What happens if you alter line 3 and make Y a string variable by adding $ (so that it becomes Y$), and also alter every other occurrence of the Y accordingly ? Don't forget the difference between the ways in which numbers and words are printed by PRINT.
By now the screen must be fairly cluttered, and it would be nice to be able to wipe it clean every so often. You could use a PRINT with at least 24 colons after it, but that is not the best solution. You would think that there ought to be a special instruction to clear the screen, and there is. On the 99s it is CALL CLEAR.
You can easily incorporate the command into programs - it demands a line all of its own - and in this case we'd really like to insert it before line l, so that the screen is at least cleared to begin with. If you remember, RES can be used to juggle the line numbers a little, so make use of it to create space for CALL CLEAR to be inserted. Try, as an example of how it can be done, RES on its own:
1 CALL CLEAR
and then list the routine to check that everything has worked as intended.
Next issue we'll look at INPUT a little further, only this time we'll examine what you can do after an INPUT has been executed, to check to see if the data entered is what was asked for. This process of checking an entry is called INPUT VALIDATION, or sometimes more informally as MUG TRAPPING. It is usually closely associated with any INPUT, and an understanding of it is vital for any programmer.
End of issue
[ TI Book front page | TI Resources Page | PC99 Review | PC99 Programs ]
About the addfreestats tracker