$convert solar fire import file SFNAMES.TXT to readable format PTMP 0 INFIL 0 UTFIL 3 PAD 30000 30 STO ;number of lines to read CALL ;clear city name 4 0. $ 1 CARY ,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec, , ,B, ,AD,BC,! $ 0 20 STO ;line count 1 30 RCL FOR ;convert the SF file and save more readable version 1 INFIL 80 STO DEC 80 RCL 0 = ;exit hvis filen er lukket 80 RCL -1 = OR XIF ;eller hvis filslut er nået SFNAMES.TXT @ $ 20 RCL 1 ADD 20 STO DEC ;increment line count 0 20 1 20 STCUT ;name field 20 19 20 STCAT ;add stop char ;----------------- 0 21 21 32 STCUT ;date field 1 12 FOR 2 CNT 21 STPOS 0 STO 0 < IF ;replace month name by number 21 22 1 0 RCL 1 SUB STCUT ;day number section 2 CNT 100 ADD 23 NTOS ;month number as string 23 23 2 3 STCUT ;zero prefix 1 digit months 22 23 22 STCAT ;added 21 21 0 RCL 3 ADD 21 STLEN STCUT;add last part with year number 22 21 21 STCAT ;modified date field ENDIF NEXT 15 21 STPOS 1 STO ;BC date 0 < IF 21 21 1 1 RCL 1 SUB STCUT ENDIF 21 16 21 STCAT ;add spaces 21 21 1 11 STCUT ;and cut tail after 11 characters 1 RCL BOO 22 NTOS 21 22 21 STCAT ;add AD/BC códe 0 or 1 ;------------ 0 22 49 53 STCUT ;time field 32 -5 22 STCHR 32 = IF 13 22 22 STCAT ENDIF ;add initial space if 1-digit hour 32 3 22 STCHR ;replace char no 3 with a space 22 22 1 5 STCUT ;cut to length 5 ;------------ 0 23 43 47 STCUT ;zone hh mm 32 -5 23 STCHR 32 = IF ;last char is space means 1 digit hour 13 23 23 STCAT ;add initial space 23 23 1 5 STCUT ;and remove the trailing one ENDIF 43 -42 0 STCHR 43 = IF ;direction + means west 87 3 23 STCHR ;replace char no 3 with a W ELSE 69 3 23 STCHR ;replace char no 3 with a E ENDIF ;----------------- 0 24 60 75 STCUT ;rest of string with longitude and latitude ;------------ 20 14 20 STCAT 20 21 0 STCAT 0 14 0 STCAT 0 22 0 STCAT 0 14 0 STCAT 0 23 0 STCAT 0 14 0 STCAT 0 24 0 STCAT 1 MONS 0 NUMS 1 UTFIL SFNAMES.$$$ @ $ NEXT 0 INFIL 0 UTFIL 20 RCL NUMS total ##### lines written to temporary file SFNAMES.$$$ $__________ re-read the temporary file_____________ 0 80 STO ;initier filslut flag 1 CARY ,,,,W,S $ 20 RCL 30 STO 0 20 STO 30000 NPNT 0 STO ;sæt navnefilpointer til enden af denne fil MAC= MAC+ 30000 NPNT ,og dupliker sidste navn $ 30 RCL 0 < IF 1 30 RCL FOR ;sæt sløjfe igang $ 20 RCL 1 ADD 20 STO DEC ;inc line count 1 INFIL ;hent linie data 80 STO DEC ;gem status 11 0 FOR 2 CNT STO DEC NEXT ;gem data SFNAMES.$$$ @!# # # # # # #@1# #@2# #@3# $ 80 RCL 0 = ;exit hvis filen er lukket 80 RCL -1 = OR XIF ;eller hvis filslut er nået 80 RCL -2 = IF ;marker ukomplet linie NUMS ELSE 0 ENDIF line ##### incomplete \ $ 0 NPUT ;name $ 0 RCL 0 MEPUT ;dáte 1 RCL 1 MEPUT 2 RCL 2 MEPUT 3 RCL 3 MEPUT $ 4 RCL 4 MEPUT ;time 5 RCL 5 MEPUT $ 6 RCL 8 MEPUT ;zone 7 RCL 9 MEPUT 4 1 STPOS 0 < 11 MEPUT ;if W set direction flag $ 10 RCL 12 MEPUT ;latitude 11 RCL 13 MEPUT 5 3 STPOS 0 < 15 MEPUT ;if S set direction flag $ 8 RCL 16 MEPUT ;longitude 9 RCL 17 MEPUT 4 2 STPOS 0 < 19 MEPUT ;if W set direction flag $ ;63 -2 BDATA ;this will write data to screen MAC+ 32000 NPNT DEC ;0 NPNT 1 ADD NPNT DEC ;increment insertion point $ NEXT 0 INFIL 32000 NPNT DEC CALL 0----- END OF IMPORT -----.*Y $ 0 1 SYSTR 1 ;get current namefile name 20 RCL NUMS total ##### data lines added to current namefile: (@.nfi) $ ELSE NUMS ENDIF Import file SFNAMES.TXT empty or missing $$$