**** EXPLORE1.CMD - DISPLAY FAMILLY ON SCREEN WITH CODE IN M1 AS PRIME PERSON. *** **** version 1.0 *** getting started. ERASE set intensity on @ 1,0 SAY 'vvvvvvvvvvv PARENTS vvvvvvvvvvvvvvv' @ 4,0 SAY '------------------------- vvvvvvvvvvvvv SPOUSES vvvvvvvvvvvvvv' @ 8,0 SAY '-------------------------' @ 5,25 say ')' @ 6,25 say ")" @ 7,25 say ')' set intensity off *** look up prime person *** FIND &M1 IF # = 0 @ 23,0 @ 23,0 SAY m1+' NOT FOUND IN DATA BASE. TRY AGAIN !!' STORE f to notfirst store 'C' to command set intensity on RETURN ENDIF store t to notfirst *** display prime person @ 7,1 SAY BIRTH:DATE USING '#### ##/##' IF DEATH:DATE<>0 @ 7,12 SAY '-' @ 7,14 SAY DEATH:DATE USING '#### ##/##' ENDIF @ 5,1 SAY FIRST:NAME @ 6,1 SAY trim(LAST:NAME) set intensity on @ 6,25 say ')' set intensity off *** save data of prime person *** STORE FATHER:REF TO M2 STORE MOTHER:REF TO M3 store spse1:ref to m4 store spse2:ref to m5 store spse3:ref to m6 store str(spse1:date,8) to mdate4 store str(spse2:date,8) to mdate5 store str(spse3:date,8) to mdate6 STORE SEX TO MSEX *** find and display father *** FIND &M2 IF #=0 @ 2,0 SAY "father not found" STORE "0000" TO M2 ELSE @ 2,1 SAY FIRST:NAME @ 3,1 SAY LAST:NAME ENDIF *** find and display mother *** fIND &M3 IF #=0 @ 2,26 SAY "Mother not found" store "0000" to m3 else @ 2,27 say first:name @ 3,27 say last:name endif store 2 to row store 2 to col store 1 to l store t to true *** find and display spouses *** do while l<4 store str(3+l,1) to element if val(m&element)<>0 store str((col-1)*26+1,2) to pcol store str((row-2)*4+5,2) to prow store f to true find &m&element if #<>0 @ &prow,&pcol say trim(first:name)+' '+$(mdate&element,1,4) store str(val(prow)+1,2)to prow @ &prow,&pcol say last:name else @ &prow,&pcol say m&element+" not found" endif store col+1 to col endif store l+1 to l enddo if true @ 6,30 say "not married or spouse unknown" endif store 1 to col store row+1 to row **** display children ****************** set intensity on @ 9,0 say "CHILDREN:" set intensity off if msex="m" .OR. msex="M" store "father" to indx else store "mother" to indx endif set index to &indx store "6" to child *** look up first occurance of prime person in the *** parent index selected. find &m1 if #<>0 store "7" to child store t to true do while true *** display current child *** store str((col-1)*26+1,2)to pcol store str((row-3)*3+10,2) to prow @ &prow,&pcol say trim(first:name)+' '+$(str(birth:date,8),1,4) store str(val(prow)+1,2)to prow @ &prow,&pcol say last:name *** save childs reference number to child array *** store ref:no to m&child *** increment screen position *** if (row-2)/4 = int((row-2)/4) store 3 to row store col+1 to col else store row+1 to row endif *** look for next child *** skip if eof .OR. &indx.:ref<>M1 .OR. val(child)=22 store f to true else *** increment child array element *** store str(val(child)+1,2) to child if val(child)<10 store $(child,2,1) to child endif endif enddo *** back up to display next child *** else @ 12,5 say "no children" endif store val(child)-6 to childcount store '6' to prow store '0' to pcol @ &prow,&pcol say "*" store 2 to row store 1 to col set index to ref,father,mother,name set intensity on return