Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 9, 2019 7:32:55 GMT -5
Is there a Base date function in ThinBasic? In REXX it would be xxx = Date('B'), To convert a gregorian to base: b_date xxx = Date('B',"06/07/19","U") and to convert base to gregorian: g_date = Date('U',74322,'B') Very convenient when adding/subtracting dates.
Also is there a "remainder value" ie: that what is left over as a result of a divide? In Rexx: remain = aa//bb
Thanks
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 9, 2019 14:23:44 GMT -5
1. The REXX to ThinBasic sections says for date() use date$, so I look up date$ in ThinBasic and see no "base" function. It never occured to me to look at the DT_ functions. (Perhaps your doc needs to be updated to also include "look at the DT_ functions too.". And you are correct, my bad, I should have looked at all the ThinBasic functions first.
OK so I found dt_SecToDate and dt_DateToSec, work great, (but you must have: USES "DT").
2. Also in the "REXX to SPFLite" under Operators, it states: Operators that are the same are not mentioned. So since the Remainder operator (//) was not mentioned, I assumed it was the same in ThinBasic, so:
dim sec as number
sec = 12//5
SPF_Debug(" sec = " +sec)
which returns:
Error code: 3 Error description: Division by Zero Line code SEC - 12//5 Token found: SEC
prompting my question about remainders. Again, perhaps the doc needs updated to include "//" and "mod". And again, my bad, I should have looked at all the functions first and realized Mod would have worked. (Strange name for "give me the reminder"), but it worked exactly as I need it to. Thanks.
3. Since I'm "pushing ThinBasic real hard". I'm thinking maybe I need the full blown ThinBasic. So, I downloaded it and installed it, but I suspect I somehow need to tell SPFLite to use it rather than the built in version. Help please. Thanks.
|
|
|
Post by George on Jun 9, 2019 14:37:02 GMT -5
Ren: I know that Robert did the REXX to thinBasic guide, and frankly I didn't think we should have it at all. But he spent a considerable time doing it and my bet is that you're the first person actually using it.
It is not, and never was intended to be some definitive conversion guide, merely an overview to give a REXX programmer a fighting chance to get going.
There will be no corrections, additions etc. to that guide. As Robert said about the thinBasic documentation - it is what it is.
We do our best to create proper documentation and when you add up the SPFLite manual and the Macros manual there's over 1,100 pages. I really think we do way more than is normally expected for a freeware application.
George
|
|
|
Post by George on Jun 9, 2019 14:57:20 GMT -5
Ren: Missed your comment about the thinBasic version. I'm not sure what you were after that the new version of thinBasic offers.
Switching the version of thinBasic that SPFLite uses could range from a simple swap of thinBasic modules, to having to make interface code changes within SPFLite.
If it ain't broke, don't fix it. Until a new version corrects a significant problem, or offers some new functionality, why should we upgrade?
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 9, 2019 15:39:41 GMT -5
Directly from SPFLite Edit Macros V10.2.19129 - 2019-05-10, Converting Rexx to thinBasic:
Operators
Operators that are the same are not mentioned
Rexx thinBasic etc....
I use the Rexx to "Thin" doc all the time. It's a life saver. Thank you Robert.
Somewhere, I took the implication that one could add the full blown "Thin" to SPFLite. But I understand, if it is not broke....
Thanks again to you both.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 9, 2019 19:55:57 GMT -5
Robert, I'm just trying to help improve your manual, (based on my thought patterns). I'm sorry if no one else reads it, but like I said before the REXX to Thin doc is a life saver. :-}
I keep telling you guys what a wonderful product this is, because it is. I don't mean to be a complainer, I'm just trying to learn a new language, and am having trouble with the syntax.
|
|