xrpn 1.2.1 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xrpn +1 -0
  3. data/xcmd/abs +1 -0
  4. data/xcmd/acos +1 -0
  5. data/xcmd/adate +1 -0
  6. data/xcmd/adateiso +1 -0
  7. data/xcmd/add +1 -0
  8. data/xcmd/adv +1 -0
  9. data/xcmd/agsub +1 -0
  10. data/xcmd/aleng +1 -0
  11. data/xcmd/almcat +1 -0
  12. data/xcmd/almnow +1 -0
  13. data/xcmd/anum +1 -0
  14. data/xcmd/aoff +1 -0
  15. data/xcmd/aon +1 -0
  16. data/xcmd/appchr +1 -0
  17. data/xcmd/apprec +1 -0
  18. data/xcmd/arcl +1 -0
  19. data/xcmd/arcli +1 -0
  20. data/xcmd/arclrec +1 -0
  21. data/xcmd/arot +1 -0
  22. data/xcmd/ashf +1 -0
  23. data/xcmd/asin +1 -0
  24. data/xcmd/asroom +1 -0
  25. data/xcmd/asto +1 -0
  26. data/xcmd/asub +1 -0
  27. data/xcmd/atan +1 -0
  28. data/xcmd/atime +1 -0
  29. data/xcmd/atime24 +1 -0
  30. data/xcmd/atox +1 -0
  31. data/xcmd/aview +1 -0
  32. data/xcmd/aviewc +1 -0
  33. data/xcmd/beep +1 -0
  34. data/xcmd/bindec +1 -0
  35. data/xcmd/cat +1 -0
  36. data/xcmd/cf +1 -0
  37. data/xcmd/chs +2 -1
  38. data/xcmd/cla +2 -1
  39. data/xcmd/clalma +1 -0
  40. data/xcmd/clalmx +1 -0
  41. data/xcmd/cld +1 -0
  42. data/xcmd/clear +1 -0
  43. data/xcmd/clfl +2 -1
  44. data/xcmd/clk12 +2 -1
  45. data/xcmd/clk24 +2 -1
  46. data/xcmd/clkeys +1 -0
  47. data/xcmd/clock +1 -0
  48. data/xcmd/clp +1 -0
  49. data/xcmd/clralms +1 -0
  50. data/xcmd/clrg +2 -1
  51. data/xcmd/clrgx +2 -1
  52. data/xcmd/cls +2 -1
  53. data/xcmd/clst +2 -1
  54. data/xcmd/clx +2 -1
  55. data/xcmd/cmdadd +2 -1
  56. data/xcmd/cmddel +2 -1
  57. data/xcmd/cmdhelp +23 -0
  58. data/xcmd/correct +1 -0
  59. data/xcmd/cos +1 -0
  60. data/xcmd/crflas +2 -1
  61. data/xcmd/crfld +2 -1
  62. data/xcmd/cube +2 -1
  63. data/xcmd/d_r +2 -1
  64. data/xcmd/date +2 -1
  65. data/xcmd/dateplus +2 -1
  66. data/xcmd/ddate +2 -1
  67. data/xcmd/dec +2 -1
  68. data/xcmd/decbin +2 -1
  69. data/xcmd/dechex +2 -1
  70. data/xcmd/decoct +2 -1
  71. data/xcmd/deg +2 -1
  72. data/xcmd/degq +2 -1
  73. data/xcmd/delchr +2 -1
  74. data/xcmd/delrec +2 -1
  75. data/xcmd/divide +2 -1
  76. data/xcmd/dmy +2 -1
  77. data/xcmd/dot +1 -0
  78. data/xcmd/dow +2 -1
  79. data/xcmd/drop +2 -1
  80. data/xcmd/dropy +2 -1
  81. data/xcmd/dse +1 -0
  82. data/xcmd/ed +1 -0
  83. data/xcmd/emdir +2 -1
  84. data/xcmd/emdirx +2 -1
  85. data/xcmd/emroom +1 -0
  86. data/xcmd/end +1 -0
  87. data/xcmd/eng +1 -0
  88. data/xcmd/enter +2 -1
  89. data/xcmd/exp +2 -1
  90. data/xcmd/expx1 +2 -1
  91. data/xcmd/fact +2 -1
  92. data/xcmd/fc +1 -0
  93. data/xcmd/fcc +1 -0
  94. data/xcmd/fcs +1 -0
  95. data/xcmd/fix +1 -0
  96. data/xcmd/fixq +2 -1
  97. data/xcmd/flsize +1 -0
  98. data/xcmd/frc +2 -1
  99. data/xcmd/fs +1 -0
  100. data/xcmd/fsc +1 -0
  101. data/xcmd/fss +1 -0
  102. data/xcmd/geir +2 -1
  103. data/xcmd/getas +2 -1
  104. data/xcmd/getfile +2 -1
  105. data/xcmd/getfilea +2 -1
  106. data/xcmd/getkey +2 -1
  107. data/xcmd/getkeyx +2 -1
  108. data/xcmd/getp +2 -1
  109. data/xcmd/getr +2 -1
  110. data/xcmd/getrec +2 -1
  111. data/xcmd/getrx +2 -1
  112. data/xcmd/getsub +1 -0
  113. data/xcmd/getweb +2 -1
  114. data/xcmd/getx +2 -1
  115. data/xcmd/grad +2 -1
  116. data/xcmd/gsb +1 -0
  117. data/xcmd/gto +1 -0
  118. data/xcmd/help +2 -1
  119. data/xcmd/hexdec +2 -1
  120. data/xcmd/hms +2 -1
  121. data/xcmd/hmsminus +2 -1
  122. data/xcmd/hmsplus +2 -1
  123. data/xcmd/hr +2 -1
  124. data/xcmd/inschr +2 -1
  125. data/xcmd/insrec +2 -1
  126. data/xcmd/int +2 -1
  127. data/xcmd/invf +1 -0
  128. data/xcmd/isg +1 -0
  129. data/xcmd/lastx +2 -1
  130. data/xcmd/lbl +1 -0
  131. data/xcmd/lift +2 -1
  132. data/xcmd/ln +2 -1
  133. data/xcmd/ln1x +2 -1
  134. data/xcmd/log +1 -0
  135. data/xcmd/mdy +2 -1
  136. data/xcmd/mean +2 -1
  137. data/xcmd/mod +1 -0
  138. data/xcmd/multiply +1 -0
  139. data/xcmd/oct +2 -1
  140. data/xcmd/octdec +2 -1
  141. data/xcmd/off +2 -1
  142. data/xcmd/on +1 -0
  143. data/xcmd/p_r +2 -1
  144. data/xcmd/pack +1 -0
  145. data/xcmd/page +1 -0
  146. data/xcmd/pagedel +1 -0
  147. data/xcmd/pageq +2 -1
  148. data/xcmd/pageswap +2 -1
  149. data/xcmd/pasn +1 -0
  150. data/xcmd/pcat +2 -1
  151. data/xcmd/pclps +2 -1
  152. data/xcmd/percent +1 -0
  153. data/xcmd/percentch +1 -0
  154. data/xcmd/pi +2 -1
  155. data/xcmd/posa +2 -1
  156. data/xcmd/posfl +2 -1
  157. data/xcmd/pow +2 -1
  158. data/xcmd/pprg +2 -1
  159. data/xcmd/pprgx +1 -1
  160. data/xcmd/pra +2 -1
  161. data/xcmd/prflags +2 -1
  162. data/xcmd/prompt +2 -1
  163. data/xcmd/prp +2 -1
  164. data/xcmd/prregs +2 -1
  165. data/xcmd/prstk +2 -1
  166. data/xcmd/prx +2 -1
  167. data/xcmd/prxm +2 -1
  168. data/xcmd/pse +2 -1
  169. data/xcmd/psize +1 -0
  170. data/xcmd/purfl +2 -1
  171. data/xcmd/r_d +1 -0
  172. data/xcmd/r_p +2 -1
  173. data/xcmd/rad +2 -1
  174. data/xcmd/rand +2 -1
  175. data/xcmd/rcl +1 -0
  176. data/xcmd/rclaf +1 -0
  177. data/xcmd/rclflag +2 -1
  178. data/xcmd/rclpt +2 -1
  179. data/xcmd/rclpta +2 -1
  180. data/xcmd/rclsw +1 -0
  181. data/xcmd/rdn +2 -1
  182. data/xcmd/recip +1 -0
  183. data/xcmd/regmove +2 -1
  184. data/xcmd/regswap +2 -1
  185. data/xcmd/reload +2 -1
  186. data/xcmd/reszfl +1 -0
  187. data/xcmd/rnd +2 -1
  188. data/xcmd/root +2 -1
  189. data/xcmd/rtn +2 -1
  190. data/xcmd/rubycmd +2 -1
  191. data/xcmd/runsw +1 -0
  192. data/xcmd/rup +2 -1
  193. data/xcmd/saveas +2 -1
  194. data/xcmd/savep +2 -1
  195. data/xcmd/saver +2 -1
  196. data/xcmd/saverx +2 -1
  197. data/xcmd/savex +2 -1
  198. data/xcmd/savexm +2 -1
  199. data/xcmd/sci +1 -0
  200. data/xcmd/sdev +2 -1
  201. data/xcmd/seekpt +2 -1
  202. data/xcmd/seekpta +2 -1
  203. data/xcmd/sep +1 -0
  204. data/xcmd/setaf +1 -0
  205. data/xcmd/setsw +1 -0
  206. data/xcmd/sf +1 -0
  207. data/xcmd/shellcmd +2 -1
  208. data/xcmd/sign +2 -1
  209. data/xcmd/sin +1 -0
  210. data/xcmd/size +1 -0
  211. data/xcmd/sizeq +1 -0
  212. data/xcmd/sminus +1 -0
  213. data/xcmd/splus +1 -0
  214. data/xcmd/sqr +2 -1
  215. data/xcmd/sqrt +2 -1
  216. data/xcmd/sreg +1 -0
  217. data/xcmd/sregq +2 -1
  218. data/xcmd/stdivide +1 -0
  219. data/xcmd/stmultiply +1 -0
  220. data/xcmd/sto +1 -0
  221. data/xcmd/stoflag +2 -1
  222. data/xcmd/stop +2 -1
  223. data/xcmd/stopsw +1 -0
  224. data/xcmd/stplus +1 -0
  225. data/xcmd/stsubtract +1 -0
  226. data/xcmd/subtract +1 -0
  227. data/xcmd/sw +1 -0
  228. data/xcmd/swap +2 -1
  229. data/xcmd/swpt +1 -0
  230. data/xcmd/tan +1 -0
  231. data/xcmd/tenx +2 -1
  232. data/xcmd/time +2 -1
  233. data/xcmd/tx +1 -0
  234. data/xcmd/version +1 -0
  235. data/xcmd/view +1 -0
  236. data/xcmd/writefile +2 -1
  237. data/xcmd/xeq +1 -0
  238. data/xcmd/xeq0 +2 -1
  239. data/xcmd/xeqnn +2 -1
  240. data/xcmd/xeqy +2 -1
  241. data/xcmd/xf +1 -0
  242. data/xcmd/xgt0 +2 -1
  243. data/xcmd/xgteq0 +2 -1
  244. data/xcmd/xgteqnn +2 -1
  245. data/xcmd/xgteqy +2 -1
  246. data/xcmd/xgtnn +2 -1
  247. data/xcmd/xgty +2 -1
  248. data/xcmd/xlt0 +2 -1
  249. data/xcmd/xlteq0 +2 -1
  250. data/xcmd/xlteqnn +2 -1
  251. data/xcmd/xlteqy +2 -1
  252. data/xcmd/xltnn +2 -1
  253. data/xcmd/xlty +2 -1
  254. data/xcmd/xmexistq +2 -1
  255. data/xcmd/xmfileq +2 -1
  256. data/xcmd/xneq0 +2 -1
  257. data/xcmd/xneqnn +2 -1
  258. data/xcmd/xneqy +2 -1
  259. data/xcmd/xnn +1 -0
  260. data/xcmd/xtoa +2 -1
  261. data/xcmd/xy +2 -1
  262. data/xcmd/xyzalm +1 -0
  263. data/xlib/_xrpn_version +1 -1
  264. data/xlib/debug_mode +2 -18
  265. data/xlib/read_xcmd +4 -4
  266. data/xrpn.gemspec +2 -2
  267. metadata +6 -4
data/xcmd/delchr CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Delete X characters from current XM file starting at pointer
2
3
  def delchr
3
4
  if @xmcont[0][0] == ""
4
5
  return
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/delrec CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Delete current record from current XM file
2
3
  def delrec
3
4
  if @xmcont[0][0] == ""
4
5
  return
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/divide CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return 1\/X to X
2
3
  def /
3
4
  @l = @x
4
5
  @x = @y / @x
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/dmy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Set date mode to DD.MMYYYY
2
3
  def dmy
3
4
  @flg["31"] = true
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/dot CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Toggles Flag 28 (dot type - dot or comma as decimal separator)
2
3
  def dot
3
4
  @flg["28"] = !@flg["28"]
4
5
  end
data/xcmd/dow CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return Day Of Week for date in X
2
3
  def dow
3
4
  @l = @x
4
5
  lift
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/drop CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Drop stack
2
3
  def drop
3
4
  @x, @y, @z = @y, @z, @t
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/dropy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Drop only Z and Y
2
3
  def dropy
3
4
  @y, @z = @z, @t
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/dse CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Decrease, skip if greater using named register
2
3
  def dse (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/ed CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Go to ascii file editor (no need for that)
2
3
  def ed
3
4
  return "No need for an editor.\nEdit your files in ~/.xrpn/data/ with your favourite editor (VIM)."
4
5
  end
data/xcmd/emdir CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print data for all XM files (name and type and size)
2
3
  def emdir
3
4
  cat 4
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/emdirx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Print X'th XM file (name and type and size)
2
3
  def emdirx
3
4
  fl = Dir[Dir.home+"/.xrpn/data/*"][@x.to_i - 1]
4
5
  f = fl.sub(/.*\/(.*)\...$/, '\1')
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/emroom CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get room left in eXtended Memory (lots and lots)
2
3
  def emroom
3
4
  return "EMROOM: There's always plenty of room"
4
5
  end
data/xcmd/end CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # End of program
2
3
  def end
3
4
  p = @pc
4
5
  rtn
data/xcmd/eng CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Engineering format. Set number of decimals (fix) to n, threshold to for when exponents kick in to 6 and show exponents as multiples of 3.
2
3
  def eng (n)
3
4
  @i = n.to_i
4
5
  @g = 3
data/xcmd/enter CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Lift stack
2
3
  def enter
3
4
  lift
4
5
  @nolift = true
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/exp CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Natural exponent
2
3
  def exp
3
4
  @l = @x
4
5
  lift
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/expx1 CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # For arguments close to zero
2
3
  def expx1
3
4
  @l = @x
4
5
  lift
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/fact CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return factorial of X to X
2
3
  def fact
3
4
  @l = @x
4
5
  lift
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/fc CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag clear? If not, skip next program line
2
3
  def fc? (r)
3
4
  @flg[r] == false ? conditional(true) : conditional(false)
4
5
  end
data/xcmd/fcc CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag clear? If not, skip next program line and clear flag
2
3
  def fcc? (r)
3
4
  @flg[r] == false ? conditional(true) : conditional(false)
4
5
  @flg[r] = false
data/xcmd/fcs CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag clear? If not, skip next program line and set flag.
2
3
  def fcs? (r)
3
4
  @flg[r] == false ? conditional(true) : conditional(false)
4
5
  @flg[r] = true
data/xcmd/fix CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Fixed point display with n decimal places
2
3
  def fix (n)
3
4
  @i = n.to_i
4
5
  @s = 9
data/xcmd/fixq CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print current FIX setting
2
3
  def fix?
3
4
  return "FIX = #{@i}"
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/flsize CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get file size (alway plenty)
2
3
  def flsize
3
4
  return "FLSIZE: Always plenty of room."
4
5
  end
data/xcmd/frc CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Return fractional part of X to X
2
3
  def frc
3
4
  @l = @x
4
5
  @x = @x.frc
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/fs CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag set? If not, skip next program line
2
3
  def fs? (r)
3
4
  @flg[r] == true ? conditional(true) : conditional(false)
4
5
  end
data/xcmd/fsc CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag set? If not, skip next program line and clear flag
2
3
  def fsc? (r)
3
4
  @flg[r] == true ? conditional(true) : conditional(false)
4
5
  @flg[r] = false
data/xcmd/fss CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Flag set? If not, skip next program line and set flag
2
3
  def fss? (r)
3
4
  @flg[r] == true ? conditional(true) : conditional(false)
4
5
  @flg[r] = true
data/xcmd/geir CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Easter egg
2
3
  def geir
3
4
  puts
4
5
  puts "Geir Isene <g@isene.com> https://isene.com"
@@ -8,4 +9,4 @@ class XRPN
8
9
  end
9
10
  end
10
11
 
11
- # vim:ft=ruby:
12
+ # vim:ft=ruby:
data/xcmd/getas CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Loads XM file (any tupe)
2
3
  def getas
3
4
  load_xm(@a)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/getfile CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Read any file named in Alpha into X
2
3
  def getfile
3
4
  lift
4
5
  begin
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/getfilea CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Read any file named in Alpha into Alpha
2
3
  def getfilea
3
4
  begin
4
5
  @a = File.read(@a)
@@ -8,4 +9,4 @@ class XRPN
8
9
  end
9
10
  end
10
11
 
11
- # vim:ft=ruby:
12
+ # vim:ft=ruby:
data/xcmd/getkey CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Waits 10 seconds for user to press a key (return Character Code to X, not HP-41 key code)
2
3
  def getkey
3
4
  key = STDIN.getch(min: 0, time: 10)
4
5
  lift
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/getkeyx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Waits X seconds for user to press a key (return Character Code to X)
2
3
  def getkeyx
3
4
  @l = @x
4
5
  key = STDIN.getch(min: 0, time: @x)
@@ -7,4 +8,4 @@ class XRPN
7
8
  end
8
9
  end
9
10
 
10
- # vim:ft=ruby:
11
+ # vim:ft=ruby:
data/xcmd/getp CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get program from program file
2
3
  def getp
3
4
  f = Dir.home + "/.xrpn/data/" + @a + ".pr"
4
5
  if File.exist?(f)
@@ -10,4 +11,4 @@ class XRPN
10
11
  end
11
12
  end
12
13
 
13
- # vim:ft=ruby:
14
+ # vim:ft=ruby:
data/xcmd/getr CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get all registers from XM data file and copy to registers
2
3
  def getr
3
4
  # No reason to not allow ascii files to be read into regs
4
5
  i = 0
@@ -10,4 +11,4 @@ class XRPN
10
11
  end
11
12
  end
12
13
 
13
- # vim:ft=ruby:
14
+ # vim:ft=ruby:
data/xcmd/getrec CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Get current record from current XM file, replacing content of Alpha
2
3
  def getrec
3
4
  cla
4
5
  arclrec
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/getrx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get registers by X (bbb.eee)
2
3
  def getrx
3
4
  b = @x.to_i
4
5
  e = (@x.frc * 1000).to_i
@@ -14,4 +15,4 @@ class XRPN
14
15
  end
15
16
  end
16
17
 
17
- # vim:ft=ruby:
18
+ # vim:ft=ruby:
data/xcmd/getsub CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get sub program (no need - XRPN works with pages for programs)
2
3
  def getsub
3
4
  return "GETSUB: No need for that function. XRPN works with pages instead."
4
5
  end
data/xcmd/getweb CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get web page with URL in Alpha into X
2
3
  def getweb
3
4
  lift
4
5
  begin
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/getx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Get current record in XM data file to X
2
3
  def getx
3
4
  # No reason to not allow ascii files to be read into regs
4
5
  lift
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/grad CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Set degree mode to GRAD (400 degrees in a circle)
2
3
  def grad
3
4
  @deg = "grad"
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/gsb CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Jump to label n and return here after an RTN or END is encountered
2
3
  def gsb (l)
3
4
  xeq (l)
4
5
  end
data/xcmd/gto CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Goto (jump) to a string label, numbered label or line number (GTO "MyProg", GTO 31, GTO .214), using a dot before the line number)
2
3
  def gto (l)
3
4
  if l.match(/^\./)
4
5
  @pc = l.sub(/^\./, "").to_i - 1
data/xcmd/help CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Print help text
2
3
  def help
3
4
  puts
4
5
  puts "XRPN is a stack-based programming language. It uses Reverse Polish Notation for calculations."
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/hexdec CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Take X as a hexadecimal number and convert to decimal number in X
2
3
  def hexdec
3
4
  @l = @x
4
5
  @x = @x.to_s.convert_base(16, 10).to_f
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/hms CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Convert decimal hours to HH.MMSSsss
2
3
  def hms
3
4
  @l = @x
4
5
  h = @x.to_i
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/hmsminus CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Add hours (HH.MMSSsss) or degrees
2
3
  def hmsminus
3
4
  lastx = @x
4
5
  hr
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/hmsplus CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Subtract hours (HH.MMSSsss) or degrees
2
3
  def hmsplus
3
4
  lastx = @x
4
5
  hr
@@ -10,4 +11,4 @@ class XRPN
10
11
  end
11
12
  end
12
13
 
13
- # vim:ft=ruby:
14
+ # vim:ft=ruby:
data/xcmd/hr CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Append Alpha to current XM file at pointer
2
3
  def hr
3
4
  @l = @x
4
5
  s = @x.to_i * 3600
@@ -8,4 +9,4 @@ class XRPN
8
9
  end
9
10
  end
10
11
 
11
- # vim:ft=ruby:
12
+ # vim:ft=ruby:
data/xcmd/inschr CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Insert Alpha at pointer in current XM file
2
3
  def inschr
3
4
  if @xmcont[0][0] == ""
4
5
  return
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/insrec CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Insert Alpha before current record in XM file
2
3
  def insrec
3
4
  if @xmcont[0][0] == ""
4
5
  return
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/int CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Add a line in the printout
2
3
  def int
3
4
  @l = @x
4
5
  @x = @x.to_i
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/invf CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Invert flag (toggle flag n)
2
3
  def invf (f)
3
4
  @flg[f] = !@flg[f]
4
5
  end
data/xcmd/isg CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Increase, skip if greader for named register
2
3
  def isg (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/lastx CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Get content of Last X (L register) to X
2
3
  def lastx
3
4
  @y, @z, @t = @x, @y, @z
4
5
  @x = @l
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/lbl CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Label in a program that you can GTO or XEQ to
2
3
  def lbl (l)
3
4
  end
4
5
  end
data/xcmd/lift CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Lift stack
2
3
  def lift
3
4
  return if @nolift
4
5
  @y, @z, @t = @x, @y, @z
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/ln CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Natural logarithm
2
3
  def ln
3
4
  @l = @x
4
5
  @x = Math::log(@x)
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/ln1x CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # For argumants close to 1
2
3
  def ln1x
3
4
  @l = @x
4
5
  @x = Math::log(1 + @x)
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/log CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Logarithm with base 10
2
3
  def log
3
4
  @l = @x
4
5
  @x = Math::log10(@x)
data/xcmd/mdy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Set date mode to MM.DDYYYY
2
3
  def mdy
3
4
  @flg["31"] = false
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby: