home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 5 / RISCWORLD_VOL5.iso / SOFTWARE / Issue3 / FAMILY / Calendar / Demo / BASIC / Test3 (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  2003-09-20  |  918 b   |  37 lines

  1.  test calendar
  2. $ " at line " 
  3.  JulMon$(12)
  4.  Jan, Feb, Mar, Apr
  5.  May, Jun, Jul, Aug
  6.  Sep, Oct, Nov, Dec
  7.  I%=1 
  8.  JulMon$(I%):
  9.  "Test3: For a given date, calculate the date that is N days away"
  10. )atod% = 
  11. ident("Calendar_JDayToDate")
  12. )dtoa% = 
  13. ident("Calendar_DateToJDay")
  14.  "FROM:"
  15.  "Calendar (0=stop, 1=julian, 2=gregorian, 3=hebrew, 4=islamic): "c%
  16.  c%=0 
  17.  "Year   : "y%
  18.  "Month  : "m%
  19.  "Day    : "d%
  20.  dtoa%, c%,, y%,m%,d% 
  21.  ,from%
  22.  "(JDay="from%")"
  23.  "Offset       : "f%
  24. jday%=from%+f%
  25.  atod%, c%, jday% 
  26.   ,,r2%,r3%,r4%
  27. @%="G2"
  28.  ""r2%"-"JulMon$(r3%)"-"r4%
  29.  c%=0
  30. ident(swiname$)
  31.  convert the given swi name to a swi number
  32.  and print the result
  33.  swinr%
  34.  "OS_SWINumberFromString",, swiname$ 
  35.  swinr%
  36. =swinr%
  37.