1 ' A simple GW BASIC program to access Sky Catalogue 2 ' Volume 1, Second Edition. 3 ' Copyright (c) 1991 Sky Publishing Corporation 4 ' 49 Bay State Road, Cambridge, Massachusetts 02138 5 ' 12/27/93 6 ' this program displays only a fraction of the information contained in 7 ' the catalogue and is intended to be used as an example 8 cls ' clear the screen 10 print : print "Sky Catalogue 2000.0, Volume 1" 12 print "Second Edition" 14 print "Copyright (c) 1991 Sky Publishing Corporation" 15 print 16 print "This example program displays only a fraction of the" 17 print "information contained in this catalogue (program ver. 1.04)" : print 21 input "Press to continue";zxz$ 22 ' open Sky Catalogue volume 1 second edition 23 DIM s$(451)' allow up to 450 stars to be displayed 24 f$="SKYCAT.DAT" ' the file name is assigned to the variable f$ 26 OPEN "R", 1, f$, 107 ' open f$ as #1 as random access, with a length of 107 30 FIELD #1, 7 AS hdnumber$, 6 AS saonumber$, 12 AS starname$, 7 AS ra$ 32 FIELD #1, 32 AS dummy$, 7 AS dec$, 5 AS pmra$, 4 AS pmdec$, 4 AS v$ 34 FIELD #1, 52 AS dummy$, 3 AS code$, 4 AS bv$, 3 AS mv$ 36 FIELD #1, 62 AS dummy$, 16 AS spectraltype$, 4 AS radvel$, 5 AS distcode$ 38 FIELD #1, 87 AS dummy$, 5 AS ads$, 4 AS adssuffix$, 1 AS commonname$ 40 FIELD #1, 97 AS dummy$, 1 AS variablename$, 1 AS clustermember$ 42 FIELD #1, 99 AS dummy$, 4 AS hrnumber$, 3 AS multflag$, 1 AS lastcode$ 44 CLS ' clear the screen 46 PRINT 48 INPUT "Enter the beginning RA (Hrs, Min, Sec)";x1a,x1b,x1c 50 INPUT "Enter the ending RA (Hrs, Min, Sec)";x2a,x2b,x2c 52 PRINT 54 INPUT "Enter a magnitude limit (<=8.0)";maglimit 56 cls :print: print "searching... " 58 ' place entered RA coordinates in same format that they appear in the catalogue 60 IF LEN(STR$(x1a))=1 THEN x1a$="0"+(STR$(x1a)) 62 IF LEN(STR$(x1a))=2 THEN x1a$="0"+RIGHT$(STR$(x1a),1) 64 IF LEN(STR$(x1a))=3 THEN x1a$=RIGHT$(STR$(x1a),2) 66 IF LEN(STR$(x1b))=1 THEN x1b$="0"+(STR$(x1b)) 68 IF LEN(STR$(x1b))=2 THEN x1b$="0"+RIGHT$(STR$(x1b),1) 70 IF LEN(STR$(x1b))=3 THEN x1b$=RIGHT$(STR$(x1b),2) 72 IF LEN(STR$(x1c))=1 THEN x1c$="0"+(STR$(x1c)) 74 IF LEN(STR$(x1c))=2 THEN x1c$="0"+RIGHT$(STR$(x1c),1) 76 IF LEN(STR$(x1c))=3 THEN x1c$=RIGHT$(STR$(x1c),2) 78 x1c$=x1c$+"0" ' add a zero to the end 80 enteredbegra$=x1a$+x1b$+x1c$ 82 IF LEN(STR$(x2a))=1 THEN x2a$="0"+(STR$(x2a)) 84 IF LEN(STR$(x2a))=2 THEN x2a$="0"+RIGHT$(STR$(x2a),1) 86 IF LEN(STR$(x2a))=3 THEN x2a$=RIGHT$(STR$(x2a),2) 88 IF LEN(STR$(x2b))=1 THEN x2b$="0"+(STR$(x2b)) 90 IF LEN(STR$(x2b))=2 THEN x2b$="0"+RIGHT$(STR$(x2b),1) 92 IF LEN(STR$(x2b))=3 THEN x2b$=RIGHT$(STR$(x2b),2) 94 IF LEN(STR$(x2c))=1 THEN x2c$="0"+(STR$(x2c)) 96 IF LEN(STR$(x2c))=2 THEN x2c$="0"+RIGHT$(STR$(x2c),1) 98 IF LEN(STR$(x2c))=3 THEN x2c$=RIGHT$(STR$(x2c),2) 100 x2c$=x2c$+"0" ' add a zero to the end 102 enteredendra$=x2a$+x2b$+x2c$ 104 IF LEFT$(enteredendra$,1)="0" THEN enteredendra$=" "+RIGHT$(enteredendra$,6) 106 IF LEFT$(enteredbegra$,1)="0" THEN enteredbegra$=" "+RIGHT$(enteredbegra$,6) 108 GOSUB 172 ' search subroutine 110 k=0 112 WHILE ra$ < enteredendra$ 114 k=k+1 115 if k>450 then goto 300 116 GET #1, i ' access database 118 i=i+1 126 ddv$=LEFT$(v$,2)+"."+RIGHT$(v$,2) ' used for mag comparison 128 dv$=" V"+LEFT$(v$,2)+"."+RIGHT$(v$,2)+" " ' used for display 130 ' put RA in the proper format 132 rah$=LEFT$(ra$,2) 134 mah$=MID$(ra$,3,2) 136 sah$=MID$(ra$,5,2) 138 sah2$=RIGHT$(ra$,1) 140 fra$=rah$+"h "+mah$+"' "+sah$+"."+sah2$+sa$ 142 ' put Dec in the proper format 144 ddec$=LEFT$(dec$,3) 146 mdec$=MID$(dec$,4,2) 148 sdec$=RIGHT$(dec$,2) 150 fdec$=ddec$+"d "+mdec$+"' "+sdec$+sa$ 152 par$=" RA "+fra$+" Dec "+fdec$+" "+" "+dv$+c$ 153 nvm$=str$(k) 154 IF VAL(ddv$) >maglimit THEN k=k-1 ELSE s$(k)= nvm$+" HD "+hdnumber$+" SAO "+saonumber$+" HR "+hrnumber$+par$ 156 WEND 157 IF k=0 THEN PRINT: PRINT "No stars found" : goto 164 158 cls 159 for z=1 to k 160 print s$(z) 161 next z 162 gosub 250 164 CLOSE ' close open file 165 print: input "Do you wish to quit (y/n)";ques$: if ques$="n" then run 23 166 input "Do you wish to return to DOS (y/n)";ques2$:if ques2$="y" then cls: system 167 END ' end of program 168 ' *************************************************** 170 ' subroutines 172 ' search subroutine 174 ' Search subroutine -- enter with 'enteredbegra$'; exit with i set to 176 ' the record number just before the desired R.A. 178 I0=1: I9=50071! ' total number of stars in the catalogue 180 i=INT(I9/2) ' start in the middle of the file 182 d=i 184 d=INT(d/2) 186 IF d=0 THEN 196 188 GET#1,i: tempra$=ra$ 190 s=1: IF tempra$>enteredbegra$ THEN s=-1 192 i=i+s*d 194 GOTO 184 196 IF i=I9 THEN 202 198 IF ra$0 THEN GET#1,i 202 IF ra$>=enteredbegra$ AND i>1 THEN 200 201 cls: print: print "reading..." 204 RETURN 250 if k<22 then return ' if there is less than one screen full 251 Print:Print"There are ";k;"listed stars": 255 Input"Of the listed stars would you like to list any of them again (y/n)";qq$ 257 if qq$="n" then return 260 Input "Enter the Starting and the Ending number (n1,n2)";sn1,sn2 270 for c=sn1 to sn2 275 print s$(c) 280 next 282 print :input "Would you like to look at any more in this list (y/n)";qq$ 283 if qq$="y" then goto 260 290 return 300 print "error... this program is limited to displaying 450 lines" 305 print "please decrease the search area" 307 print : input "Press to continue";ZZCX$ 308 goto 44