home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / carcosts / rexx / test.rexx next >
OS/2 REXX Batch file  |  1996-11-02  |  2KB  |  121 lines

  1. /* Test Carcost's ARexx-Port */
  2.  
  3. /* Basename is ALWAYS >CARCOSTS.x<, even if you call the programm */
  4. /* >AUTOKOSTEN<...                                              */
  5. address "CARCOSTS.1"
  6.  
  7. options results
  8.  
  9. help "con:0/0/640/200/CarCosts_ARexx_Test/wait/auto"
  10.  
  11.  
  12. say
  13. info title
  14. say "Title    : "result
  15. info version
  16. say "Version  : "result
  17. info author
  18. say "Author   : "result
  19. info copyright
  20. say "Copyright: "result
  21. info base
  22. say "Base     : "result
  23.  
  24. say
  25. say "Test of fuel list"
  26. say
  27.  
  28.  
  29. getfuelnumber
  30.  
  31. max = result-1
  32.  
  33.  
  34. do i = 0 to max
  35.  getfuelinfo date i
  36.  datum=result
  37.  getfuelinfo km i
  38.  kms = result
  39.  getfuelinfo price i
  40.  prices = result
  41.  getfuelinfo liter i
  42.  liters = result
  43.  getfuelinfo lperkm i
  44.  lperkms = result
  45.  getfuelinfo dkm i
  46.  dkms = result
  47.  say datum "," kms "," liters "," prices "," dkms "," lperkms
  48. end
  49.  
  50. /* Now an error */
  51. say
  52. say "An example for a wrong ITEM"
  53. say
  54. getfuelinfo anything 5
  55. say result rc
  56.  
  57.  
  58.  
  59. say
  60. say "Test of support list"
  61. say
  62.  
  63. getsuppnumber
  64. max = result-1
  65.  
  66. do i=0 to max
  67.  getsuppinfo date i
  68.  dates = result
  69.  getsuppinfo price i
  70.  prices = result
  71.  getsuppinfo title i
  72.  titles = result
  73.  getsuppinfo remark i
  74.  remarks = result
  75.  say dates "," titles "," remarks "," prices
  76. end
  77.  
  78.  
  79.  
  80. say
  81. say "Test of summary function"
  82. say
  83.  
  84. getsummary STARTDATE
  85. say "Startdate     : " result
  86. getsummary ENDDATE
  87. say "Enddate       : " result
  88. getsummary KMSTART
  89. say "KM at start   : " result
  90. getsummary LITER
  91. say "Liter         : " result
  92. getsummary KM
  93. say "KM            : " result
  94. kms=result
  95. getsummary CONSUMPTION
  96. say "Consumption   : " result 
  97. getsummary PRICEFUEL
  98. say "Price fuel    : " result "=> " result/kms "per km"
  99. getsummary PRICESUPPORT
  100. say "Price support : " result "=> " result/kms "per km"
  101. getsummary SIGN
  102. say "All data for car : " result
  103.  
  104.  
  105.  
  106. say
  107. say "Test setxy-commands"
  108. say
  109.  
  110. /* RC = 10: Wrong date       */
  111. /* RC =  5: Negativ distance */
  112. setfuelentry "22.12.93 24345 23.45 30.00"
  113. say result rc
  114. setfuelentry "23.12.93 25345 23.45 30.00"
  115. say result rc
  116.  
  117.  
  118.  
  119.  
  120. setsupportentry '"23.12.93" "Test of item" "test2 of item" "55.30"'
  121. setsupportentry '"1.1.88" "test test test" "" "123.45"'