xrpn 1.2.1 → 1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1 -1
  267. metadata +3 -2
data/xcmd/sci CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Scientific format. Set number of decimals (fix) to n, threshold to for when exponents kick in to 9.
2
3
  def sci (n)
3
4
  @i = n.to_i
4
5
  @s = 6
data/xcmd/sdev CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Standard deviation for X and Y to the X and Y registers
2
3
  def sdev
3
4
  @l = @x
4
5
  lift
@@ -8,4 +9,4 @@ class XRPN
8
9
  end
9
10
  end
10
11
 
11
- # vim:ft=ruby:
12
+ # vim:ft=ruby:
data/xcmd/seekpt CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set pointer of current XM file to X
2
3
  def seekpt
3
4
  @xmcont[0][3] = @x
4
5
  @xmcont[0][3] = @xmcont.length.to_f - 2 if @xmcont[0][3] > @xmcont.length - 2
@@ -7,4 +8,4 @@ class XRPN
7
8
  end
8
9
  end
9
10
 
10
- # vim:ft=ruby:
11
+ # vim:ft=ruby:
data/xcmd/seekpta CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Set pointer of XM file named in Alpha to X
2
3
  def seekpta
3
4
  load_xm(@a, @x)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/sep CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Toggles Flag 29 (separator for every 3 digits)
2
3
  def sep
3
4
  @flg["29"] = !@flg["29"]
4
5
  end
data/xcmd/setaf CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set clock accuracy factor (no clock function)
2
3
  def setaf
3
4
  return "SETAF: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/setsw CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set stopwatch (no stopwatch here)
2
3
  def setsw
3
4
  return "SETSW: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/sf CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set flag n
2
3
  def sf (r)
3
4
  @flg[r] = true
4
5
  end
data/xcmd/shellcmd CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Executes the shell command in Alpha. Gives you access to all of Bash inside XRPN.
2
3
  def shellcmd
3
4
  system(@a)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/sign CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Swap sign of X (X becomes -X and -X becomes X)
2
3
  def sign
3
4
  @l = @x
4
5
  lift
@@ -16,4 +17,4 @@ class XRPN
16
17
  end
17
18
  end
18
19
 
19
- # vim:ft=ruby:
20
+ # vim:ft=ruby:
data/xcmd/sin CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return SIN of X to X
2
3
  def sin
3
4
  @l = @x
4
5
  @x = @x.to_rad if @deg == "deg"
data/xcmd/size CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set size of memory (no need, lots of room)
2
3
  def psize (n)
3
4
  return "SIZE: No need for that function"
4
5
  end
data/xcmd/sizeq CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Returns size of memory (no need, lots of room)
2
3
  def size?
3
4
  return "SIZE = A Lot"
4
5
  end
data/xcmd/sminus CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Delete data values from statistical accumulation
2
3
  def sminus
3
4
  @l = @x
4
5
  @reg[(@srg.to_i + 0).to_s] = 0 if @reg[(@srg.to_i + 0).to_s] == nil
data/xcmd/splus CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Add data values to statistical accumulation
2
3
  def splus
3
4
  @l = @x
4
5
  @reg[(@srg.to_i + 0).to_s] = 0 if @reg[(@srg.to_i + 0).to_s] == nil
data/xcmd/sqr CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Return square of X to X
2
3
  def sqr
3
4
  @l = @x
4
5
  @x = @x ** 2
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/sqrt CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Return square root of X to X
2
3
  def sqrt
3
4
  @l = @x
4
5
  @x = Math::sqrt(@x)
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/sreg CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set start of statistical registers to n
2
3
  def sreg (r)
3
4
  @srg = r
4
5
  end
data/xcmd/sregq CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Return start of statistical registers to X
2
3
  def sreg?
3
4
  return "ΣREG = " + @sreg
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/stdivide CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Store divide (divide the content of reg n by X in reg n)
2
3
  def stdivide (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/stmultiply CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Store multiply (multiply the content of reg n by X in reg n)
2
3
  def stmultiply (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/sto CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Store X in register n
2
3
  def sto (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/stoflag CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Restore flag status from X (uses different, more readable flag status format)
2
3
  def stoflag
3
4
  flags = @x.split(" ")
4
5
  flags.each do |fv|
@@ -10,4 +11,4 @@ class XRPN
10
11
  end
11
12
  end
12
13
 
13
- # vim:ft=ruby:
14
+ # vim:ft=ruby:
data/xcmd/stop CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Halt program execution (and enter "Debug mode")
2
3
  def stop
3
4
  $debug = true
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/stopsw CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Stop stopwatch (no stopwatch here)
2
3
  def stopsw
3
4
  return "STOPSW: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/stplus CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Store plus (add X to the content of reg n in reg n)
2
3
  def stplus (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/stsubtract CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Store subtract (subtract X from the content of reg n in reg n)
2
3
  def stsubtract (r)
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/subtract CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Subtract X from Y
2
3
  def -
3
4
  @l = @x
4
5
  @x = @y - @x
data/xcmd/sw CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Stopwatch (no stopwatch here)
2
3
  def sw
3
4
  return "SW: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/swap CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Swap registers
2
3
  def swap
3
4
  @x, @y = @y, @x
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/swpt CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Stopwatch and pointers (no stopwatch here)
2
3
  def swpt
3
4
  return "SWPT: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/tan CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return TAN of X to X
2
3
  def tan
3
4
  @l = @x
4
5
  @x = @x.to_rad if @deg == "deg"
data/xcmd/tenx CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Return ten to the power of X to X
2
3
  def tenx
3
4
  @l = @x
4
5
  @x = 10 ** @x
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/time CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Return a formatted time in X to Alpha
2
3
  def time
3
4
  lift
4
5
  @x = Time.now.strftime("%H.%M%s").to_f
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/tx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Add X to clock time (no clock function)
2
3
  def tx # T+X
3
4
  return "T+X: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/version CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Show the XRPN version number
2
3
  def version
3
4
  xrpn_version
4
5
  end
data/xcmd/view CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # View (print) the content of register n
2
3
  def view (r)
3
4
  puts @reg[r]
4
5
  end
data/xcmd/writefile CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Write X as content to file named in Alpha
2
3
  def writefile
3
4
  begin
4
5
  @x = File.write(@a)
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/xeq 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 xeq (l)
3
4
  page, pos = locate_prg (l)
4
5
  if pos == nil
data/xcmd/xeq0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xeq0?
3
4
  @x == 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xeqnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line (reg NN in Y)
2
3
  def xeqnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xeqy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xeqy?
3
4
  @x == @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xf CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # X exchange flag status (flags 0-7)
2
3
  def xf # X<>F
3
4
  fsumx = 0
4
5
  7.times do |f|
data/xcmd/xgt0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgt0?
3
4
  @x > 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xgteq0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgteq0?
3
4
  @x >= 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xgteqnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgteqnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xgteqy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgteqy?
3
4
  @x >= @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xgtnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgtnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xgty CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xgty?
3
4
  @x > @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xlt0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xlt0?
3
4
  @x < 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xlteq0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xlteq0?
3
4
  @x <= 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xlteqnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xlteqnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xlteqy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xlteqy?
3
4
  @x <= @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xltnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xltnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xlty CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xlty?
3
4
  @x < @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xmexistq CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Checks if XM file named in Alpha exists (returns file type and YES or NO)
2
3
  def xmexist?
3
4
  f = Dir.home + "/.xrpn/data/" + @a
4
5
  if File.exist?(f + ".da")
@@ -12,4 +13,4 @@ class XRPN
12
13
  end
13
14
  end
14
15
 
15
- # vim:ft=ruby:
16
+ # vim:ft=ruby:
data/xcmd/xmfileq CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print name of current XM file
2
3
  def xmfile?
3
4
  return "XMFILE = #{@xmfile}"
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xneq0 CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xneq0?
3
4
  @x != 0 ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xneqnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xneqnn?
3
4
  r = @x.to_i
4
5
  r = "%02d" % [r] if r == r.to_i.to_s
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/xneqy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Conditional - if not true, skip next program line
2
3
  def xneqy?
3
4
  @x != @y ? conditional(true) : conditional(false)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xnn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Exchange X and content of register n
2
3
  def xnn (r) # X<> r
3
4
  case r.downcase
4
5
  when "x"
data/xcmd/xtoa CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Add character from character code in X to Alpha
2
3
  def xtoa
3
4
  @a += @x.to_i.chr
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xy CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Swap X and Y
2
3
  def xy
3
4
  @x, @y = @y, @x
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/xyzalm CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Set alarm (no alarm functions implemented)
2
3
  def xyzalm
3
4
  return "XYZALM: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xlib/_xrpn_version CHANGED
@@ -1,5 +1,5 @@
1
1
  def xrpn_version
2
- puts "XRPN version: 1.2"
2
+ puts "XRPN version: 1.3"
3
3
  end
4
4
 
5
5
  # vim:ft=ruby:
data/xlib/debug_mode CHANGED
@@ -1,5 +1,5 @@
1
1
  def debug_mode
2
- prompt = TTY::Prompt.new
2
+ #prompt = TTY::Prompt.new
3
3
  loop do
4
4
  if $prompt
5
5
  @line = prompt.ask(":")
@@ -7,23 +7,7 @@ def debug_mode
7
7
  else
8
8
  puts "─" * 30
9
9
  @p.prstk
10
- print "> "
11
- @ln = STDIN.getch
12
- while IO.select([STDIN], [], [], 0) != nil # Flush STDIN (remove control chars)
13
- STDIN.getch
14
- end
15
- if ["+", "-", "*", "/", "%"].include?(@ln)
16
- print "\e[32m" + @ln + "\e[0m\n"
17
- @ln = [@ln]
18
- @line = hp_41(@ln)[0]
19
- break
20
- elsif @ln == "\r" # A simple ENTER
21
- @line = "lift"
22
- puts "\n"
23
- break
24
- end
25
- print "\e[1G\e[K" # Clears from the beginning of line (removes getch prompt)
26
- @line = prompt.ask(">", value: @ln)
10
+ @line = @debugprompt.ask(">")
27
11
  unless @line == nil or @line.length == 1
28
12
  @line = [@line]
29
13
  @line = hp_41(@line)[0]