home *** CD-ROM | disk | FTP | other *** search
- *********
- * COUNTRY.PRG
- *
- * by Ralph Davis
- * modified by Tom Rettig
- *
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Demonstrates use of DOSFUNC procedure.
- *********
-
- CLEAR
- m_buff = ALLOCATE(1000)
- m_seg = SUBSTR(m_buff,1,4)
- m_off = SUBSTR(m_buff,5,4)
-
- FOR i = 0 TO 254
- @ 0, 0 SAY i
- m_ax = '38' + SUBSTR(HEX(i),3,2)
- m_bx = '0000'
- m_cx = '0000'
- m_dx = m_off
- m_si = '0000'
- m_di = '0000'
- m_ds = m_seg
- m_es = '0000'
- m_regs = m_ax + m_bx + m_cx + m_dx + m_si + m_di + m_ds + m_es
- m_flags = 0
-
- CALL dosfunc WITH m_regs, m_flags
-
- IF m_flags % 2 == 0
- ?
- ? "COUNTRY NO: " + LTRIM(STR(i))
- m_date = PEEKINT(m_seg,m_off)
- DO CASE
- CASE m_date == 0
- ? "Date format: USA (mm/dd/yy)"
- CASE m_date == 1
- ? "Date format: European (dd/mm/yy)"
- CASE m_date == 2
- ? "Date format: Japanese (yy/mm/dd)"
- ENDCASE
-
- m_curr = PEEKSTR(m_seg,DEC(m_off)+2)
- ? "Currency symbol: " + m_curr
- m_thou = PEEKSTR(m_seg,DEC(m_off)+7)
- ? "Thousands separator: " + m_thou
- m_dec = PEEKSTR(m_seg,DEC(m_off)+9)
- ? "Decimal separator: " + m_dec
- m_datesep = PEEKSTR(m_seg,DEC(m_off)+11)
- ? "Date separator: " + m_datesep
- m_timesep = PEEKSTR(m_seg,DEC(m_off)+13)
- ? "Time separator: " + m_timesep
- m_currform = PEEKINT(m_seg,DEC(m_off)+15)
-
- IF m_currform % 2 == 0
- ? "Currency symbol precedes the value"
- ELSE
- ? "Currency symbol follows the value"
- ENDIF
-
- m_spaces = INT((m_currform/2)) % 2
- ? "There are " + LTRIM(STR(m_spaces,1,0)) + " spaces " +;
- "between the value and the symbol"
-
- m_sign = PEEKINT(m_seg,DEC(m_off)+16)
- ? "Significant decimal digits in currency: " + LTRIM(STR(m_sign))
-
- m_timeform = PEEKINT(m_seg,DEC(m_off)+17)
- IF m_timeform % 2 == 0
- ? "Twelve hour clock in use"
- ELSE
- ? "Twenty-four hour clock in use"
- ENDIF
-
- m_caseoff = HEX(PEEKINT(m_seg,DEC(m_off)+18))
- m_caseseg = HEX(PEEKINT(m_seg,DEC(m_off)+20))
- ? "Case map call address: " + m_caseseg + ":" + m_caseoff
- m_datasep = PEEKSTR(m_seg,DEC(m_off)+22)
- ? "Data list separator: " + m_datasep
- ?
- ?
- ? "Press any key to continue, <Esc> to abort..."
-
- IF INKEY(60) == 27 && Escape key aborts
- RETURN
- ENDIF
-
- CLEAR
- ENDIF
- NEXT
-
- IF .NOT. DEALLOC(m_buff,1000)
- ?? CHR(7)
- ? 'Error freeing memory'
- ENDIF
-
- CLEAR
- RETURN
- * eof: country.prg
-
-