Author Topic: OT Basic  (Read 73828 times)

0 Members and 2 Guests are viewing this topic.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #30 on: August 11, 2010, 04:06:53 pm »
I have another suggestion, This one I borrowed from Visual Basic.
Code: [Select]
Try
..some code
Catch
..errorhandling code
End try

The try-catch-end statement Tries to run the code, if it fails however the error is "catched" and can be handled appropiately. In Visual Basic one would do:
Code: [Select]
Try
..some code
Catch ex as Exception
..errorhandling code
End Try
However for OTBasic I'd just do "Catch" instead of "Catch ex as Exception" or worse "Catch System.Diagnostics.Rightrestrictions as Exception" (< that is not a real error btw). Also "End Try" can be "End". The use of this is that you can safely test code and use code that might not work on every calc. Say a user has for some reason restricted rights on a calc and A program does a function/command or whatever that falls outside those rights, then the user would get a message saying what the problem was, thanks to try-catch-end.
I think it is specifically handy for programs or routines that are prone to errors. Since I assume there is a implented break function to prevent (like we have now, the on that prevents RAM clears) it might be less useful. It really depends on how the OS is programmed and if there is something like 'rights' cause then it's useful.

Edit1:
For the Language Design section: How about a undo/redo function? So if you accidentally hit clear you can still get your line back. I would make the redo's/undo's limited though to keep memory usage low. Maybe even auto-backupping when enabled? (for the paranoid amongst us)
Edit2:
I Have no clue whatsoever how the KOS GUI is gonna look like but maybe we could implent some of it's GUI elements (e.g. Button, Label, WindowForm (once again I dunno if these will actually exist, just saying)) make them callable as drawing functions. This could however be also a external "package" which brings me to my next idea. Making the langauge 'package' compatible. With that I mean that certain commands can be added via a package. This package contains the tokens for the commands and KOS compatible routines to run them. This way users can extend the langauge to their likingning.
Edit3:
Another conditional structure I'd like to see is this one (which I borrowed from batch):
Code: [Select]
If Exists sString
..do something
End
This tests whether string String exists or not. This can be useful to say, have user able to remove a game but to save the game data/save game. With one check you could then easily see if there was any saved that and act appropiately. I think this is very, very useful!
« Last Edit: August 11, 2010, 04:18:40 pm by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #31 on: August 11, 2010, 05:01:00 pm »
Tokens like sin( are length 1 when put into a string on the TI-84. This can be annoying sometimes, because they appear as 4 characters. I think the OTZ80 should take sin( as 4 characters when using the length( command.

It would be cool if you had routines like toUpperCase and toLowerCase for a string.  :D

Also, it would be good if you could convert from number to string and vice versa, or better yet be able to add a number and a string to get a string.

Two-dimensional menus are a must, in my opinion.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #32 on: August 11, 2010, 05:02:49 pm »
Possible would be having a non-token based system, or have it only use tokens internally, and not for editing.
String routines would be cool.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: OT Basic
« Reply #33 on: August 11, 2010, 05:11:59 pm »
suggestions added.

program4, what do you mean by two-dimensional menus?


Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #34 on: August 11, 2010, 05:28:26 pm »
Like the MATH menu on the TI-84, not the apps menu: there is an up and down dimension, and left and right (in a program).
« Last Edit: August 11, 2010, 05:28:46 pm by program4 »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: OT Basic
« Reply #35 on: August 11, 2010, 05:37:11 pm »
how about we can check to see if variable currently exist.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #36 on: August 11, 2010, 05:43:01 pm »
I think matthias1992 suggest an "IfExists" for that, but bumping it is fine ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #37 on: August 11, 2010, 09:05:13 pm »
I had an Idea for merging this Basic language with the harder language I proposed. Add-ons is the keyword. I'd like to see libraries and packages included which I define as follows

The use of a SDK or library is to add aditional functionality that wasn't available in the bare-bone version of OTBasic which is by default included in the OS. Now any PACKAGE completely overwrites the Oncalc-editor and the tokens/commands and replaces it with the Default Bare-Bone commands + the added commands. A LIBRARY is a seperate file that can be included in the Prgram itself using something like: "UseLib([libname])" This adds tokens without overwriting the Bare-Bone editor. The side-effect is that a external file (the Library) is needed.

So basically you can use new commands when adding a library. When adding a package you can simply pack multiple libraries into on file which itself is inherit to the OS. So shortly said: a library adds one external file, a package adds  multiple libraries but doesn't make a external file. It becomes a part of the editor as if it was already rpogrammed with these extra commands.

I hope I don't confuse anyone with this IDEA. It's just a suggestion.
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #38 on: August 12, 2010, 08:51:49 am »
Your idea would be great, except that the programs that use the libraries would not be compatible with someone that doesn't have the libraries. I think that these libraries should be automatically included in the OS, but you should need an external application to access them (just like the extra variables on the TI-84).

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #39 on: August 12, 2010, 09:35:30 am »
Sounds good.
program4: The solution to that is to package the library with the program, and perhaps give the device a central libraries location. If the libraries the program needs are already there, you can just have the device discard the extra copies.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #40 on: August 12, 2010, 09:43:25 am »
Sounds good.
program4: The solution to that is to package the library with the program, and perhaps give the device a central libraries location. If the libraries the program needs are already there, you can just have the device discard the extra copies.
Exactly. Whenever you do something like: UseLib([LibName]) it knows it has to send/include the library as well. I like the central libraries Idea alot. Just like you had apps on the original TI-8x you can now have a same sort of place for packages and libraries. That would be pretty awesome :P. Imagine a 3Dlibrary being created, you can then in OTBasic do 3D stuff with poly's and so! That is because every library is programmed in assembly so it runs real fast! That would be pretty awesome right?
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #41 on: August 12, 2010, 09:51:23 am »
You sorta reminded me of the never-used OpenLib( and ExecLib( commands on the 84+(SE). :P
Though libraries would actually be libraries and not stand-alone apps ;D
Although this is more of a device suggestion than BASIC language suggestion, will there be folders? I'm assuming yes, since you plan to use KOS or something similar. Maybe a /libs folder for everything library-related. :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #42 on: August 12, 2010, 10:03:36 am »
You sorta reminded me of the never-used OpenLib( and ExecLib( commands on the 84+(SE). :P
Though libraries would actually be libraries and not stand-alone apps ;D
Although this is more of a device suggestion than BASIC language suggestion, will there be folders? I'm assuming yes, since you plan to use KOS or something similar. Maybe a /libs folder for everything library-related. :)
I believe there attemtps/plans at making a FAT like filesystem but I can't tell for sure. Would be great though. I never really understood OpenLib() and ExecLib().
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #43 on: August 12, 2010, 10:26:58 am »
So, a quick digression to explain what they are.
Basically, they allow you to use a specially formatted flash app as a library. You choose the library with OpenLib(, and send commands to it with ExecLib(. Note that the app really only has one entry point, though, since ExecLib( only takes one argument.
The only app I know of to use this is Usb8x.

And yeah, SirCmpwn plans a hierarchal file system. (If I get my OS finished fast enough, mine will too ;D)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #44 on: September 03, 2010, 05:58:40 pm »
I just thought of some more commands we might want to include namely random number generators and sorting commands (to sort lists but maybe also to sort strings?? (migh be useful when delimiting))

any ideas on that?
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-