home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 5 / RISCWORLD_VOL5.iso / SOFTWARE / Issue3 / FAMILY / Calendar / Demo / BASIC / Test4 (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  2003-05-27  |  1.0 KB  |  38 lines

  1.  test calendar
  2. $ " at line " 
  3.  "Test4: Try to trigger a 'SWI not available for this calender' error."
  4. )atod% = 
  5. ident("Calendar_GDayToDate")
  6. )dtoa% = 
  7. ident("Calendar_DateToGDay")
  8.     )wtoa% = 
  9. ident("Calendar_WeekToGDay")
  10.  "Calendar (0=stop, 1=julian, 2=gregorian, 3=hebrew, 4=islamic): "c%
  11.  c%=0 
  12.  "Year   : "y%
  13.  "Month  : "m%
  14.  "Day    : "d%
  15. !r0%=0:r1%=0:r2%=0:r3%=0:r4%=0
  16.  dtoa%, c%,, y%,m%,d% 
  17.  r0%,r1%,r2%,r3%,r4%
  18.  "GDay "r0%" "r1%" "r2%" "r3%" "r4%
  19.     r0%=0
  20. r2%=0:r3%=0:r4%=0
  21.  atod%, c%, r1% 
  22.   r0%,r1%,r2%,r3%,r4%
  23.  "Date "r0%" "r1%" "r2%" "r3%" "r4%
  24. !r0%=0:r1%=0:r2%=0:r3%=0:r4%=0
  25.  wtoa%, c%, y%,m%,d% 
  26.  r0%,r1%,r2%,r3%,r4%
  27.  "Week to Gday: "r0%" "r1%" "r2%" "r3%" "r4%
  28.  y%=0
  29. ident(swiname$)
  30.  convert the given swi name to a swi number
  31.  and print the result
  32.  swinr%
  33.  "OS_SWINumberFromString",, swiname$ 
  34.  swinr%
  35.  "OS_SWINumberFromString "swiname$" = "
  36. ~swinr%
  37. =swinr%
  38.