Skip to main content

Full text of "Australian National OS9 Newsletter (May 1989)"

See other formats


ATTR Syntax: Attr filename [permissions] Usage : Examine or 
change the security permissions of a file Opts: -perm = turn off 
speci ' 
inhibi 



f^ed permission permr turn on specified" permigsion -a 



ax 



s - nc 
to owi 

Sir - 
yntai 
one d< 
single 
BasicO 
filena 
CHD S 
specif] 

Usage : Fi 

Usace 

Syntax 
one fil 
Date [t 
specif; 
: Chec 
for woi 
= save 
cluster 

rint 

<devn 

ilenan 
delete 
directo 

[e] W 
names 
execute 



I 



rms : d - directory file 
tft.:.pwner w - write permit 
JiP read permit to public 
iifermit lo public BACKUP 
l^j Copies all data from 

"""^' error occurs s = 
IH-ites BASIC09 Syntax : 
gBUHD Syntax: Build 
'"*rom standard input 
;1 working directory to 
iiisage: Change execution 
nlenamel filenames 
x: Cobbler devname 



[^eaTes uS-9 DootHrap'^ current boot CONFIG 

- * ■- TT r ^.^i. t — V ..A, .-J ,— 1.. ^ ^igj^g C0PY 

data from 



AUSTRALIAN 
0S9 

NEWSLETTER 



EDITOR : 
Gordon Bentzen 
8 Odin Street 
SUNNYBANK Old 4109 



(07) 345-5141 






.1,.''^' 



<.- *>i 



' '>M'> ■ ■ ' J i ' ' 'i. ' JJJ.M. I 'I J "1* ■ ■ k ' 1 1 1 1 1 1 1 1 1 I f J 



lifsSyntax : 

is: i = 
ilil> Usage 
'iiftctory 
-m 
unused 
i||i-o = 
iHniame> 
lliel [-x] 

ilfceldir 
ifcx: Dir 

Mk=print 
ee : 



Display 9 cm^mmmm^^^mimm^m^^mm syntax 

: Dsave [-(^IpMPiSIBMiiisiiiillii^iiM file 

to copy all flies in a directory system Opts : -b make a system 
disk by using OSQboot if present -b=<path> = make system disk 



using pat 
process b 
command 
ECHO Syn 
output EI 
text edit 



3 *P- 



MAY 1989 



do not 
makdir 
ftifium K 
lliiard 



H I L M . I HU.— ^ 



^■■■^ liii|iiiaiiiame> 



Usage: Chain w'^e^-pv^iiWilttPTOreiB^^ 

<devname> Usage : Initializes an OS-9 diskette Opts ; R - Ready L 

- Logical format only "disk name" 1/2 number of sides 'No of 



AUirJTRAL I AN ObV NEwSLh i i EK 
Neii^sletter of thB Naticnal OSt User Groui 



iiDITOR = GordDH Benrzen 



HbLTL^ij ' i^DD iJcVriES aTlG iJQ 



■wH j-'C: ; ac 






W& h5V9 TECEiVEG 58V5rSi r9QU95T5 "Gi^ PUDIIC OGIIiSin SOTt'^BTE GUT^HQ ThE idST ii^DHrn? rcQU=5t5 lynlCr! 1 OSi-IEVB HsVE 
51 i iJBcm TliiSdx i finO a Cai i Ti^Drn GHc fsiciilDEr (i^HG HcG rGCSlVEG HIE G1SK5 Oy "ETUr'Tl ^'iSli Gnli; tG TIHG Tiici. i ficG 

rGriTiautEC ODE Gt hlE GISKS Gild dpp5r9ntiy rOr^Gttcn TG GGPM ^lirS tG il* r'iBSSE 151 Hjg KHGu; IT 1 ficVB SilppcG Up 



PlEdSET pieasE send us fGrmatted disks lufieTi ^E^uBstirg cdpies Gf tne puoli: 
TorfTici -.nci. you iiESG BTiG yGU znoUiG HOT ridvs =:ir;u Gi; iiCLLiiy in rEdGing tns 









-.I-. !^ ■ ^, ■!-: 



i.ii-i !,;.— ,t 1 1 H 1-!.-.-. -i-,-, 4-k-.-^. i.- t*--'^-- 






■L:C--l lU-i:- 



{JPtEriiiinE a;na 



L iiUU) li 



iy i-JciKi visib iizrii-bi ir i. i. tr! ci i 



iore int^ 






liyiDg '-'linG a '^jQuu ucai •_". l':!c ii:;}^ i-- -.n- a- Ta u; z-c idu i. i ■■•i qi -.Ji^i.--- Tisc-', ; ca>_i-r> z- u.-cj! v ;.■_= -cr^ ^ ;tc ::it-::D-! =-iijp -J r 

-j-k.— . iM -. + 1 r-i r- "!■ 1 ilCCJ f !C?3*i"i ;' - J-, r-. I I n i i^ i- ^ i > HgC ^'r-.i^^.—. ;.i -- 4-!-. -. i->r\,-^ri HaZ- ' -"^ "=• .-^ ■. f ■-. 2, ■ Ji i s '^ "" ^ -.-i-.,-! 4-Kr-,.— i~. r-.c-t ~ '^ ;"'.(-'—' <" ■"• 'riC; -.'--.,-1 ■^- wi ! -. 1-. j-1 -^ .— . 



not hdVE an ansuier at this pGintr IhEEE relatE to 0S9 application pToqra^mBS 



■ [-. -* C" i-i ''- *"■ ^' "^ ~' rr. {- ■-' - — * !-, L; — , .^. ^. Li l : K \ 1 ^ ^- *"*■ '-"S 



T^rt ■*■ ■-. .-1 i 1 (.■ 






;ne sortujarE rEviEUis that u^e nave id 

nUinGEr of ffiEiliDErEi EG lijc ^iOUiCi DS qiiu 

QLiys! snai^E u*iT;i us ^ii thoss iiti^t ggs anu ggh' ls rna^ you riBVc: isarnt ■■.(■> 



nnr youi" CGiTiiTiEnts on any vJj't' EOTtijjar'E ^aLKa^t: that yuu usr. ^^onic on 



inis nsiiisiErrEr is proGUCiiG usin^ "oiyiL^Q/'apn ^y i^rsai. r^iains LoiripUiSr lg, loano Us--j-i. runninQ c 
icyiG Gges puitc a 9^^^^ joo* out gges go SGiiiE sri^an9E rnin9s liiiir; 019 riiES at tifnss. Lan anycoGy c 



tTiiS cGitiun uiE navE inGiUGEd a iisrinQ o? aii curi^sni i^iEiTiDErs ot the usEr" 'jr^^Li^ 



']iid 



net iiiGiuGEd iTierriber's tslEpnonE nun^bErs as not all /iiEiTidars inay uiant thsir -ujiibEr publishEd, Ths infor^^atiGn 
prssented mil hoiiJEVEr, allGiii you to Jidke initial cGntart dy "-ail if you i^ish. You may j 
that you arE not alonE as an 0S9 ussr m your a^sa. 



'_'= -■Vir'- 



Isarn 



Part 3 of the databast in C by Bob DEvriea is inGludsd, as is somt 
systefn, Don BerriE iiiay have a little surpr-ise for ua^ so rEad on. 



■C Vw.- L'HCJZiiijJ^ 



Koss Kratt froiii Coorna has suDiHittsd ih^ sourGS for his ''h);d" hENadEGifj?aI duiiip togsthEr ujith his conmE' 
nandy utility. Many thanks Ross. 



^lT^ ■*-■;■ T^r■••-■■^ rr.,-.,-. 4-k K -.r-.^ij ACOtt-. r. 



AUSTRALIAN CSV NEUIELETTER 



nai ana ^^'^ii cuiiip ^rcgra^iiic 



Tint like the for-iat of the go uni/i utilit^^ 
utuity. 



riS-Cl 1 GU^iP PrC^rdlTll; 



;=:u .U ui; -vc ^iJiiiiiliii-yri ii 



G GO al li;GrK aHG i did 



ihs prGgrSiiij^e ii^nicn l navB called n>iG can nave any TiU^Der- at argui^erirs (tilasj to GU?iip yjt. it can also 
Starr the duiiip a: any pcinr in the fiUs, H;;g (liUST have at least one co^^^niano line aryun^ent. The n^st thing it 
checKS for argc to de less than 2i if true it prints the fDr^i&z en 'he ^rr-^Bn ano then SMits. Next it cnecks for 
the offset option, if this is true it again cnecks for at least tu^o arcu^i^ents. If all is o< than it gets the o^fser 
iTiu PidCes ir into numa sne li^niie stareri&ni cnecKS tne nuUioer or arPufiienis 5nd men 09creiT;ents it oy onei ne/it it 
attempts to open the file of that nairie. If it fails a iiiessage is printed on the soreen and the proaraiTiifie exits. 
After a successful call to open the file^ the naiiie of the file is printed on standard cut and then tne function 
dump IS called. This function prints out a block of Ic cr^a^^ctErs m heiiadeciu^ai e.T]d then m ascii. ^irst it calls 
pflmit to tell the cciiiPiler t:\&t it iJili be printing cut a long integer? then it prints out the heading. The file 
pointer is set at the offset (zero or yhatever). The first for loop checks for the EOF cr^drdCt^r- and mcrenjents j 



;n.Lij 






a I t n e oeg inning o t ea c n 



i li^irit 



T^e- 



.Tr^:. 



long the file 16 characters and places 



,f -i- !-. .-. 



cnaracter m iiiie? ai lOc saiiie ;inie imt is b-paceo out as it is pi^inrec. ^he it state-'i&nt checKS ihe vaiue c 
space oet^een ine ne/'aGeciria^ anc rne ascii sec^ion or rne ime is printed. • '^e last '^o^ ^ccj pi^ints ou" 

arQUiTieni ano ir true tne process repeats overt 



LiiC 

sou^ 



nope you reaoers enjoy rhis progra/TiiiieT Nou; tsere's tns 






* -rograiT-iiie ma — thexaGecimai UUmP. 
^ Aiithor Ross Pratt 

+ m it"s arPUinent iisis tne iornat is iieKaoei 



^mciuae 

jTiamHdrgc^ dT^'-^'f 
I n r argc? 



char arwM / .; 

long nufii = 3f atolO; 

mt 1 = 2} -j = St a ■ 



if(argc < 2) /* check for at least 1 arguiiisnt +/ 

+ .-Mjv tr. -. + t \ * 

else 

( /* check if Offset parajneter */ 



AUSTRALIAN 039 NEWSLETTER 






T + 1 ^. w, ri ^ -■" * i / it - f- 4-+-, ^,y>p. r^T-. ^^1 1 ft I-. — *a ^ti iw.r^^. + ^ JL 






/i ric- -rr.r-. -. tt. .-.■,, ti + .-. +■ i-i ■?■ e^ .- r- ■*- X/ 



-.■i-r-,*i ; -Tv; in. \ ' 






/ * CDUiO not ^iHc 



-: .- * . 









our lHE Mi8 i^srifcC "^z 



OUIDp ^ lilT ^ nU"! f ! 



* GUiDP ~ trip tunctiori "cnai gq==- B^i t^^t: ^o) 



*tp^ 
J ! 



ilTit^L iDJ' 



i --cK • ; H^ J* i.'/ ) 



lt« i * iri 









AUSTRALIAN 0S9 NEWSLETTER 

lineLl] = 46; 
printfCy.c", lineLl]); 
} 
printf(''\nM; 
if(++i == 16) 
I 

printf("\n\n")i 
headingO; 
i = 0i 
} 
} 
} 

headingO /* Heading - prints out the Heading at the top of each Block */ 
{ 

printf< "Address 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F "); 
printf ( "0123456789ABCDEF\n" ) J 

printf ( ■ " ) ; 

printf ( " \n' ) ; 

} 

formatO /* Format - print the correct forfuat when needed */ 

( 

fprintfistderr," Incorrect argument Li5t\nh/;d [ -oof f set J filenameE f ilenaiT(e]\n'); 

} 

ooooooodogOOOOOOOOOOoooooooooo 

The 0S9 Operating System 

In the last two editions ue touched on 0S9 module types, the kernel, bootstrapping the system and how to merge any 
selected user modules with the shell module. It does seem that at least some readBrs of the newsletter are 
interested in the comments presented. So if you can stand it, I will prattle on (to borrow Bob's description of my 
efforts) a bit more. 

It is hard to know just where to go from here, but perhaps a few comments on getting the most out of OS? would be 
in order, especially for the beginners. This also follows a theme set by Rosko in his well presented articles on 
Microware C. 

I will comment on 0S9 running on the CoCo systems as this probably covers most people new to 0S9. 

Firstly, the hardware requirements that are desirable lead us to thoughts of a hard disk systemT however such a 
system is probably not for everybody for a number of reasons, not the least of which is the price tag. We do need 
to consider just how far the budget will stretch or just what sort of investment we Are willing to make. The 
decision we each make will also be influenced by our own reasons for running 0S9, or for computing at all. 

Well, I am one of those who has not as yet installed a hard disk system and can only look on with envy at those 
hard diskersi a la Don Eerrie and many others in our group. 

O.K. so all this doesn't help you very much, A very workable and useful systeai can be achieved without a hard 

disk. 

Firstly you will definitely need two \2) floppy drives. Although 0S9 can be run on a single drive system, it is 

nothing less than painful, especially if that single drive is only 35 or 40 track single sided. 

The 0S9 operating system uses disk access a lot. So if you do want to run 0B9 and have a single drive system? then 
do yourself a favour and invest in a second drive. The frustration you will save yourself will be well worth the 
investment. I am running three (3) 80 track double sided drives, which although not quite my plan, have proven to 
be a great advantage. The number of disk changes I have to do is now greatly reduced, as I can boot from a system 
disk in drive 0, run applications from drive 1, and still have another drive for data disk or whatever. It is great 
to have a full CMOS directory sitting in drive 0, and be able to 'dsave' from /dl to /d2. 



age 4 



AUSTRALIAN 0S9 NEWSLETTER 



Nguj if you lijouid like to see your favorite prograiiffrte running even faster than it would on a hard disk syBte^i, a rafii 
disk Liiil speed things up no end. Thi= is of particular advantage with Euch prograirtiries as "Profile" or other 
databases. There is a public dariain driver "'rdiiif^ier' and descriptor Vi3'' mhich can be added to the 0S9Eoot, The 
CoCo3 systeni uill need to have 512k to use this effectively. We have been using R0 to siniulate a 35tr single 
sided disk, Ujhich allou;s a 'backup' of a standard disk, and is a quick way of loading prograriETies or data files to 
the rafii disk. The use of a rafn disk for data of course has sofTie risks as this is hardly a perjiianent record. When 
data processing is cofnpleted the updated files can be transferred to a floppy by a file copy or backup. The data 
on the ram disk rfi can be recovered even after a re~boot of 0S9. If "iniz ri3" is the first cofTi.Tiand in your startup 
file and "foririat /r0" is NOT includedt the data previously stored will still be there. A siiriple 'dir /r0' will 
confirfTi this. Thanks to Don Eerrie for this discovery. Don also provided the source code for a VB" descriptor 
that allciiis it to be used tiiith D, P. Johnson's ''SDisk3"; refer to our July 'SB newsletter. 

Just a brief aside before I iriove off disk drives. As I said, m system was not plarmed around 3 >: 8S track drives. 
TiiiD drives worked just fine apart froiif the fact that the S3 track drives could not conveniently read a standard 
Jjtr. RS Dos disk, Sg> as inany CoCo oujners have been using TEAC FDjSF 80 tr drives which could easily be made to 
simulate 46tr iiiode by simply switching out a particular resistor on the drive board, I decided to take the plunge 
and order such a drive. TEAC have revised the FDjSF to such an e>;tent that we have not been able to find a method 
of the desired mode switching. Has anybody out there found a simple solution to this problem? 

If you are using a CoCo 1 or CoCo 2 you will of course be running 0S9 Level 1 with 64k of memory. Beyond this you 
can add extra memory which is usable only as a ram disk. This does add some advantage to level 1, but unless you 
have already made this modification, I would suggest that the purchase of a CoCo 3 or perhaps something else would 
be a better way to go. 

If you already have a CoCo 3 and have net added a jl2k upgrade, then may I suggest that you do. The Microware 0S9 
level 2 distributed by Tandy for the CoCo 3 almost demands this 512k. I say almost because it will run on a 123k 
computer, but you will very quickly find that multitasking is extremely limited. 

In summary then, two disk drives are a must, 512k on a CoCo 3 is also a must. Now you will be able to get close to 
running 0S9 the way Microware intended it. You will soon find however, that the CoCo hardware, in particular the 
operation of the disk controller, will severely limit multitasking. The Tandy disk controller interface uses 
interrupts of the processor which prevents any other processing to take place whilst a disk drive is being 
accessed. The result is that you find yourself waiting for each disk access to complete before you can do 
anything. The 0S9 clock module will not keep correct time for this very reason. 

f 
Now there is an answer to this problem. It does require the parting with a few more dollars though. I have 

recently added a 'no-halt' controller to my CoCo3 system which has resulted in such an improvement that I can only 

describe it as MAGIC. I have the "Disto" controller manufactured and distributed by CRC COMPUTERS Montreal, 

Canada. 

This controller works on all CoCos 1, 2 & 3 with or without the Multi-Pak interface. The controller comes with 

special device drivers needed to utilize the special buffered mode. This uses memory installed in the controller 

so that all sectors being written to or read from the disk will be done via a sector buffer. The result is that 

the 6329 is not halted between bytes, and you are able to fly along without waiting for the CPU to allow reading of 

the keyboard or anything else for that matter. The manual does warn that you should not do anything else whilst 

formatting a disk because 'format' takes up almost all the processor time. Well warnings are there to be ignored 

aren't they. I have carried on running other processes whilst in the middle of a format without problems, although 

things do slow down noticeably. 

I have been sidetracked this month and not covered much of the operating system as such, but I do hope that my 
comments en the desirable hardware will help some of you to make your venture into 0S9 a little more enjoyable, 
Ne>;t month I will try to return to the subject of the 0S9 operating system. Perhaps a short note to us with a 
suggestion on what you need to know will get me back on the track. 

Gordon Bentzen 

oDOoooooooOOOOOOOOOOooooooDooo 



F'agc: 



AUSTRALIAN 0S9 NEWSLETTER 

Motor On iTfCdifi cat ions for FD532 disk drives 
A further note by Bob Devries. 

In last iTionths issue I mentioned the jutiiper change necessary for the Tandy FD series disk drive* to alioui the 

iTiDtor-on signal to turn on the drive iriotor instead of the select signal , which uould otheriuise create problerrts 

especially under 0S9. I have since found out that the change I described was for the FD5i31 drive only. 

Here is the (riodification for the FD502 drive- The Uiain control board' has a juutper iiiarked '5' which needs to be 

iTjoved to the alternate position also iriarked '5\ Unfortunately* the board needs to be removed to change the jumper. 

To do this, reniove the three plugs near the 34 inay connector, being careful with the two flimsy plastic ones. The 

three conductor piactic one needs to be released by prising up the white plastic collar that holds it, and then 

removing the lead. Undo the three screws and remove the board, not that it is still held by the motor connexions. 

Remove that connector also. 

Locate the jumper marked '5' ne;;t to the 34 way connector, and remove the link. Solder a new link into the 

alternate position, and you're all done. Re-assemble the board to the drive, and re-install the connectors, 

ooooooooooOOOOOOOOOOOooooooooooo 

PROBLEMS WITH DSAVE 



I have two single sided disk drives and at one time I was running only 35 tracks with a slow stepping rate. After 
talking to fellow 0S9'ers I realised that niy drives can cope with 40 tracks and 6 millisecond stepping rate. Eewdy 
I thought, more disk space. 

I got hold of a 40 track boot disk through the local user group and promptly set out to reformat ail my 0S9 disks 
and transfer all the files onto the newly formatted disks. Easy - just type backup /dB /dl and away you go. Like 
fun. The ^rrur- message comes up with "disks not formatted the same!". Well of course not, thats the whole idea! I 
was now in a dilemma - what can I do. I could try copying one file at a time but that would take from now to 
eternity to accomplish! I know what to do; Til go BACK to RS-DOS and use the basic command "BACKUP' but that 
didn't work too well either. 

I rang Bob Devries and asked him what I should do. He said to use DSAVE. "What is DSAVE?' I enquired. The 
answer is what I wanted to hear "Well DSAVE is a command in your CMDS directory and is specifically designed to 
transfer files from differently formatted disks,' "THANK YOU BOB" was my reaction and away I went to use my new 
found knowledge. 

Into drive goes my 35 track system disk and into drive 1 goes the newly formatted 40 track -disk. Then I followed 
the instructions given to me. DSAVE /d0 /dl ! SHELL . What a bewdy! Its working! ' My files are being transferred 
all by them selves. What's that! ERROR 244! Not to worry only one out of a hundred files. Oops not again - another 
error ERROR 243 Oh no not another! Well DSAVE seemed like a good idea at the time. I know what to do. Just write 
down the files that DSAVE didn't copy properly and copy them in 'long hand' later. After copying ten files across 
I finally had a system disk on 40 tracks. 

Proud of Hiy new aquisition I went to work on it. First thing I did was to boot up with it. Everything was fine 
until the startup file tried to read the PRINTERR file and came up with the dreaded ERROR message, ERROR 214 NO 
PERMISSION. What's all that about! PRINTERR with no permission. Bull! Weil lets use ATTR PRINTERR and see. 
ds_wr_wr is what came up. No can't be - PRINTERR is not a directory. Oh well its easy to fix. DELDIR 
/d0/CMDS/printerr is the logical answer. Guess what - it didn't work! I tried to use ATTR PRINTERR -D but that 
didn't work either. Nothing I could do would allow me to change the file or delete the file! All I could do was 
to rename it. SO I did - I called it RINTERR, then I copied the file into the command directory from my backup 
disk. I took a closer look at other files and found that several other files were also 'directories". I could not 
delete them either. 

This problem had me bamboozled for a long time. I would ask people for help but no-one could help me. Now what 
can I do? 



Page 6 



AUSTRALIAN 0S9 NEWSLETTER 

Well it 50 happened that one of the ladies at work had an old full height disk drive (bare) that her hubby couldn't 
get to work. She gave it to ine to give to fiiy boys for final destruction, I didn't give it to the boys but took it 
to a friend' 5 place to try to resurrect it. While uie worked on it quietlyi I noticed that when he addressed drive 
the motor on drive 1 would start up. Hom coirte? It seeiris that 0S9 requires it as it does not alloni tifiiB for the 
drives to get up to speed. When using BACKUP or (wait for it) D3AVE it ffiay corrupt the disk being written to 
because it is trying to write to a disk that is not up to speed yet! Sounds too good to be true! 

Off hoiTie I went to once again apply my knowledge. Off carrie the diskdrive cover and in went the fingers. Would you 
believe it. My TANDY drive is not latched with the Chinon drive. So I found out how to latch it. On the circuit 
board is a jumper link (similar to the one to select the drive number) with another pin ne>:t to it. The extra pin 
had been cut off, I soldered another pin on and relocated the jurnper link. Now when either drive is addressed the 
other drive motor starts up. Fantastic! 

Quick. Out with 0S9 system disk. Try DSAVE. HURRY! Well it seenis to be working but don't get your hopes up too 
high. DSAVE went right through the system disk WITHOUT any errors! Amazing ain't it. I can now run SDISK and a 
couple of other programmes that address two drives without any problems. 

Now I am a happy little 0S9'er once again and keen to use commands such as DSAVE as much as possible. So to ariyone 
else who is having trouble with DSAVE - just check that the your drive motors are latched. 



Peter Barendrecht. 

GOO 00 ooOOOOOOOOO Oo oooo do go oo 

A Database in C. 

By Bob Devries 

This is part three of iriy database programme in C. The two functions printed here draw the data mask on the 
screen^ and put the current record into the blanks. 

The function scrnmaskO only prints to certain locations on the screen and clears the screen of a previous 
data record. The function scrndataO reads the a record^ whose number is given in the recno parameter passed to itj 
and prints each field in its correct location on the screen. 

Here then is this month's code, 

scrnmask ( ) 

/* scrnmaskO clears the screen and draws the mask of the data boies with */ 

/* their titles */ 

{ 

cursor(jT5}; /* position cursor */ 

printfC Surname [ ]");/* print field contents */ 

cursor i40i5}; 

printfrPirstname [ IMl 

cursDr(5w); 

printf( "Street C Y)'^ 

cursor (5^3) ; 

printfrCity [ IM ; 

cur5Dr(5i9); 

printfCState [ 3'); 

cursor (5, 10); 

printf( "Postcode [ r)\ 

printf('\n\n\nM; 

} 



scrndata(recno) 
int recno i 



Pagc^ 



AUSTRALIAN 069 KOEWSLETTER 



/* scrrKlataO reads the current reow froa the file and prints it on the */ 

/* screen in the alloted places */ 

{ 

if (recno < 1) /* test to see if you've gone too far back */ 
recno =1; /* and set to of« if so */ 

fseek(fp, (long) ((recno-l)*si2eof (sail) ),0)s /* goto record rmb&r */ 

fread(tdiail,sizeof(Bail),l,fp); /* read the data in V 

scrnaaskO; /* clear the screen of old data */ 

cur SOT (14, 5); /* position cursor */ 

printf{"Xs",iail.surna»e)j /* print the field contents */ 

cursor (51,5); 

printf("3£s",iail.fir5tnaae); 

cursor (13, 7); 

printfCXs", sail. street); 

cursor (11,8); 

printf("5£s", Bail, city); 

cursor (12, 9); 

pr intf ( "Xs" , Bai 1 . state) ; 

cursor (15, 10); 

pr intf ( "X4d" , »ai 1 . postcode) ; 
> 



ooooooooooOOOOOOOOOOoooooooooo 



8ETTINQ THE ENVIROismENT FOR YOUR C COMPILER 



1>ie following short Basic09 prograwe arose froa a conversation Nith Bob I>evries, Me were discussing probleie 
relating to the Hicroiiare C (^oapiler, and it's lack of any nethod to autonatically include graphics, and other 
library support. This problea is caused by the fact that ccl (or t^e patched ■cc2" version -. see Septeaber 1988 
Newsletter) writes a procedure file, c.coa, which handles all of the sequential steps of preparation, coapiling, 
optoaizing, assenbly and linkage. Unless you physically edit this file to include other library resotrces, the 
linker will ^nerate "unresolved reference" error aessages when you try to call fuxtions which are not in the 
standard library. 

Ue figured that the best way to achieve this was to use the -r option with the existing coapiler, and then add the 
necessary library options via a Ba5ic09 procedure. As an added feature, we thought that it would be nice to 
include full pathnaaes to the relevant directories. This will aake it especially useful for hard disk users. One 
thing you will have to reaenber, however, is that the standard coapiler looks in the directory /dl/DEFS to locate 
its ffinclude files, t^^ten they are enclosed in O's, as in linclude <stdio.h>. If you plan coapile prograas outside 
those specific directories, you will need to provide full pathnaaes in your source code, and enclose thea in 
parenthesis, eg linclude "/HO/COHPILER/DEFS/stdio.h". I also have included sufficient error trapping so that if 
there is a problea, you won't be left with ayriad overlay windows hanging around. 

At about the saae tine, I had also been fiddling with soae interesting screen aanipulation techniques, so I decided 
to include an exploding window effect wl^iich is well worthwhile having a look at, even if you are not interested in 
t^ie erivironaent setting part of the prograaae. 

The prograame also attespts to save the pathnaaes (again for hard disk and 80 track drive users) to a directory 

Page 8 



AUSTRALIAN 089 hEMSLETTER 

na»ed SYS in the root directory of the device containing the current data directory. Boy, iiihat a ■outhful. But 
think about it. The whole thing is designed to run in an 80 colion windoN, and will need the gfx2 graphics support 
nodule in neaiory, or in thie execution directory. It also »akes a coiple of other systea calls, so it will also 
need to have access to them. You'll see the SHELL calls in the source code. There is just one caveat. Reteaber, 
this was an extreaely rough and t^ick exercise, and therefore I cannot gaurantee that there are no hidden errors or 
other hiden lurkers. There is at least a framework for some pretty neat inprovefterits. I look forward to seeing 
sone aodifications froa within our neabership. 

If you would like to discuss the prograiuBe, I will be only too happy to talk to you. Please cwitact le on (07) 
375-3236. 

Cheers I>on Berrie. 



PROCEDURE env»aker 

mi explode 

DIK fpatrh, flag: BYTE 

DINcfile,rfile:STRING[301 

DIW keypress:STRIN6{3] 

DIW errno: INTEGER 

DIN libpath,aidspath,sourcepat^i:STRINGt30] 

PRINT 

PRINT "Searching for /SYS/ccotp. env" 

PRINT 

ON ERRtW? SOTO 10 

OPEN Ifpath/ /SYS/cc<MP-env":READ 

ON ERROR 
PRINT 
SOTO 15 
10 errno=ERR 
m ERROR 
IF errno=216 TJ€N 

PRINT "Envirorwwt directory/file not found" 
ENDIF 
PRINT 

PRINT "Input pativane for library files (eg. /HO/U^LIB. . . ) 
INPUT libpath 
PRINT 

PRINT "Input patfvane for Coepiler CMDS directory :"; 
INPUT cBdspath 

FtxINT 'Input pathname for Coopiier source directory :"; 
imn sourcepath 

PRINT "Create envirorrtent file (Y/N) :"; 
INPUT keypress 
IF keypress="Y" {S( keypress="y" TJO 

CREATE tfpath, " /SYS/ccoBP-env":WRITE 

WRITE lfpatl^i,libpatl^i 

WRITE «fpath,c»dspath 

WRITE tfpath, sourcepath 
ENDIF 
GOTO 18 
15 READ tfpath, libpath 
READ tfpath, ddspat^i 
READ tfpath, sourcepath 
18 CHD sourcepath 
CHX CBdspath 



Pa^e 9 



AUSTRALIAN 0S9 NEWSLETTER 

PRINT "Input filenaiK to compile :"; 

ON ERROR 90T0 100 

IhFUT cfile 

PRINT 

PRINT "Is graphics 5i?>port required (Y/N) :"; 
20 INPUT keypress 

keypre55=LEFT$ (keypress, 1 ) 

IF keypress="Y" m keypress=*y" TJCN 

flag=l 

GOTO 25 

ENDIF 

IF keypressO-N" OR keypress<>"n" J\€H 

^TO20 

EHblf 

flag=0 
25 aCLL 'cdZ ■+cfile+" -r" 

rfile=LEFT*(cfile,LEN{cfile)-2)+\r" 

PRINT Mink:" 

IF flag=0 TICN 

»€LL "rliryc ■+libpath+Vcstart.r ■+rfile+" -o='+LEFT$(cfile,LEN(cfile)-2)+" -l="+libpath+"/clib.r 

ELSE 

SHELL Vlink "+libpath+'/cstart-r "+rfile+" -o="+LEFT*(cfile,LEN(cfile)"2)*- -l="+libpath+"/clib.l 
l="*libpath+Vcgfx.l -l="+libpath+Vsys.l" 

EM)IF 

SHELL "del c.ccm" 

SHELL "del "+rfile 

RUN mexplode 

PRINT "Prograa successfully cooipiled" 

CLO^ tfpath 

END 
100 RtH unexplode 

CLO^ tfpath 

ON ERROR 

PRINT "ERROR - Pro^aiB not coii¥>iled" 

SHELL "del "+rfile 

S^el "del c.cw- 

END 



PR(XH4J« explode 
RW gfx2("0Hset', 1,39, 11,2,2,5,5) 
RUN gfx2(''0Hset",i,29,8,22,8,5,5) 
mi gfx2("0Hset-, 1,19,5,42, 14,5,5) 
RIW gfx2("owset', 1,9,2,62,20,5,5) 
RW gfx2("0Hset",l, 0,0,80,24,2.5) 
RUN gfx2("0HsetM, 2, 1,76,22,2,0) 



PROCEDifflE unexplode 
DIM i: INTEGER 
FOR i=l TO 6 
RUN gfx2("owend-) 
NEXT i 



Page 1 



AUSTRALIAN 0S9 NEW^.ETTER 



AHBROSI 


JULES 


172 OeiLVIE SIKttT 


ESSEtmt 


VIC 3040 


CoCo3 


BARENDRECHT 


PETER 


181 ttffTI FR CRES. 


HAmiASSA 


ACT 2903 


CoCo2 


BENIZbN 


GORDON 


8 ODIN SIKttT 


SUIWYBANK 


OLD 4109 


C0C03 


BERRIE 


DON 


25 IRUIN TERRACE, 


OXLEY 


OLD 4075 


COCO/ATARI 


BISSELING 


FRED 


P.O.BOX 5447 


BOROKO. N.C.D. 


PNS 


CoCo2&3 


BLANDFORD 


George U 


27 CANffiRRA SIKttT 


HOE 


VIC 3825 




BRa>IE 


MICHAEL 


P.O. BOX 109 


HUNTINGDALE. 


VIC 3166 




BROW 


ROHAN 


75 PEMBROKE ROAD 


M00R00L6ARK 


VIC 3138 


CoCo3 


CLARKE 


IAN 


12 MARFAYLEY STREET 


SALI^URY 


OLD 4107 


CoCo3 


COMBS 


RON 


25 HORILLA AVENUE 


CfflLINGt-UKD 


NSW 2118 


IBMCLOKE 


HEAN 


JMES 


P.O. BOX 549 


STH WINDSOR 


NSW 2756 


CoCo2t,3 


DEVRIES 


BOB 


21 VIRGO STREET, 


INALA 


OLD 4077 


COCO/AMIGA 


EATON 


DAVID 


20 GREGSON PLACE, 


OJRTIN. 


ACT 2605 


ATARI 


EMIARDS 


PtIbR 


40 DAVISON STHttI, 


HITCHAH. 


VIC 3132 


C0C03 


EBKILDSEN 


OLE 


11 MONARCH STREET, 


KINGSTON 


OLD 4114 


C0C03 


FSfiSCIS 


eCRS 


31 D(»IAL5 STREET 


MOR»^! 


VIC^O 


CoCo3 


FROST 


PHIL. A. 


25 CHEETHAM STREET, 


KALGUUHLIE. 


NA 6430 


C0C03 


HARRIS 


HICHAa 


P.O. BOX 25 


BRHORE 


NSW 2192 


C0C03 512K 


JACQUET 


J.P. 


27 HWPTON SIKttl. 


DURACK 


t8J)4077 


CoCo3 


JENKINSON 


CEC 


49 HUTHHAITE ST. 


UAHM UACfia 

nrfCHvi pnCKvi 


NSW 2650 


CoCo2 


KENIIY 


DOUGLAS 


2 DRYSDALE AVENUE, 


TEE TREEGIIIY 


SA 5091 


C0C01,2,3 


LONE 


HIKE 


441 MARMGAROO DRV. 


AL£XAM)ER HIGHTS WA 6064 


CoCo3 


mCLEOD 


IAIN 


150 C00LI6AH DRIVE 


mimxx> 


WA6024 




HALONEY 


Paul 


8 a.aJCESTER STREET 


JUNEE 


NSW 2663 


CoCo3 


MANNINS 


HtltK 


7 CALNON SIKttl, 


6ASSFNDEAN. 


WA6054 


CoCo3 


MRENTES 


NICKOLAS 


61 CREMH STREET 


UPPtK MT.GRAVAH OLD 4122 


C0C03 


MARTIN 


TED 


P.O. BOX 56 


ROSNYPARK 


TAS 7018 


CoCol,2,3 


MAY 


HtltK 


11 HUnON SIKttl 


CLAYFIELD 


OLD 4011 


CoCo? 


McKAY 


ROSS 


56A CORNELIA ROAD 


TOONGABBIE 


NSW 2146 


CoCo3 


NcLINTOCK 


GEORS 


7 LOGAN SIRtti, 


nrvu\HtH,ff{l/nn • 


ACT 2604 


CoCo Its 


McHASTER 


BRAD 


119 HILLOUGHBY ROAD 


CRONSNEST 


NSW 2065 


VARIOUS 


WKULSKI 


JOHN 


56 KYOOMA STREET 


TAMKIRTH 


NSW 2340 


CoCo3 


O'DONICLL 


BILL 


47/2 FRANCIS STREET 


ARTARMON. 


NSW 2064 




oaAK 


GERD 


58 ELIZAKTH PARADE 


LiWECOVE 


NSW 2066 


CoCo3 


OOSTERBEEK 


ROBIN 


P.O. KJX 1123 


DAUeiONG 


VIC 3175 


CoCo3 


PATRICK 


HAYNE 


12 O'COMFl 1 ST. 


6YMPIE 


OLD 4570 


CoCo2 


PEARCE 


U.LEIGH 


47 ALLEhfflY AVENUE, 


RESERVOIR. 


VIC 3073 


CoCoII 


PRAH 


ROSS 


31 CAMPBFII STREET, 


COOMA 


NSW 2630 


CoCol 


REID 


TJCO 


35 AVONHORE AVE. 


PORTUtND 


VIC 3305 




r^FE 


Rt» 


18 DEI6T(»i ii'Y, 


GIRRAWHEEN 


NA6064 


CoCo3 


SCHIPPLOCK 


KEVIN 


19 CELTIS STREET 


ACACIA RIDGE 


OLD 4110 


CoCo3x2 


SIDEBOnCM 


Barry 


31 miKt DAME DVE. 


SUNKJRY 


VIC 3429 


SOLDCoCo 


SIMPSON 


AM)REU 


6 S.C.KIWi CmRT 


m!INGWO(H) PARK OLD 4301 


512KC0C03 


SINGER 


MAURICE 


1 ATKA SIKttl 


TREGEAR 


NSW 2770 


CoCo3 


SKEBE 


JEFF 


92 BYNYA ROAD 


PALM BEACH 


NSW 2108 


LYNSTAN 


SLADE 


ARTHIHF 


P.O. KK 516 


SEVEN HILLS 


NSW 2147 


CoCo3 


SPOTSNOOD 


GARY 


10 DOUCH SIKttr 


NILLIAHSTOUN. 


VIC 3016 


CoCo2B 


TARVIN 


DIGBY 


P.O. MK 498 


RANDWICK 


NSW 2031 


AMIGA 


UNSiXlRTH 


ROB 


20 SALISBURY ROAD, 


IPSWICH 


OLD 4305 


CoCo3 


USHER 


JOHN 


47 PILARIS AVE. 


KIMiSION 


OLD 4114 


512KC0CO3 


UAGNITZ 


KEN 


2DEPIhfi)0 AVE 


EDEN HILLS 


SA50S0 


C0C03 


WHITE 


GREG 


2/23 LOWER PLENTY f® ROSMMA. 


VIC 3084 


CoCo3 


NRIGHT 


RON 


2 IREIC CRT. 


CHELSEA 


VIC 31% 


COC03 


HRIGHT 


SEAN 


8 ^KffiDFISH AVENUE, 


RABY. 


NSW 2566 


CoCo3x2 


Total Mobers: 


54 











Page 11