Classpad BASIC Standard Library
#41
Posted 05 January 2004 - 10:15 PM
A new, great, wonderfull classpad discovery!!!
remember statgraph? remember how it wasnt quite good enough for games on the AFX and CFX? well gues what, it work great on the classpad!
I'm working on some stdlib functions for it right now, earlyer I was literally able to move a demo level map arround the screen with barely any flicker or delay, small objects are a breeze! first I will write the functions, then I will add a define brush function to CasPaint. but for now I'll let you revel in the possibilities
#42
Posted 05 January 2004 - 10:19 PM
but seriously, the stdlib sounds brilliant, and the classpad possibilitys.....
#43
Posted 10 January 2004 - 11:43 PM
Global Variables:
CTYPE
Programs:
base(ncv, b1, b2, vars): Return type - PRAM
Converts a number ncv from a base b1 to another b2 result is stored in #vars
rectangl(xa,ya,xb,yb): Return type - NONE
draws a rectangle, did use polyline, but i changed it to use statgraph
typecode(var): Return type - RTN
returns a number coorespondant to a cell in CTYPE, used for finding the type of a variable.
Functions:
ceil(x):
rounds numbers up instead of down.
#44
Posted 14 January 2004 - 10:42 PM
#45
Posted 15 January 2004 - 12:22 AM
#46
Posted 15 January 2004 - 12:51 AM
Why notFunctions:
ciel(x):
rounds numbers up instead of down.
ceil(x)
isint it the ceiling? the smallest number that is not smaller than x.?
#47
Posted 15 January 2004 - 02:40 AM
I'm thinking about making a unit converter for the library.
I think i understood him idea. But if i remember well Overlord made a program for units convertion (like weight, distance etc...).
#48
Posted 15 January 2004 - 04:46 AM
#49
Posted 15 January 2004 - 05:22 AM
#50
Posted 15 January 2004 - 06:01 AM
Or maybe i was dreaming about the convertion program
#51
Posted 15 January 2004 - 02:19 PM
betoe (and all others ) > see the new post
#52
Posted 23 January 2004 - 03:47 AM
this update is required for CSYSTEM.
#53
Posted 23 January 2004 - 12:00 PM
#54
Posted 26 January 2004 - 07:59 PM
here are some changes to the language that will be in the next release:
- the textf() command can be accesed by the squigly t in the smbl keyboard, and not by the #
- #can now be used as it normally is in a program
- the filled 0 now causes a Pause
- the:
<--\ ----/arrow now can jump to any line in the program
#55
Posted 17 February 2004 - 06:38 PM
#56
Posted 26 April 2004 - 06:14 PM
#57
Posted 26 April 2004 - 08:27 PM
#58
Posted 19 September 2004 - 11:46 PM
Anna, programmer (diff sys/langs);
CFX-9850G since ca.1995, ClassPad300 for 3 days.
Please ask if somebody needs more.
The last post is dated Apr 26th - is stdlib still developed?
I've seen quite a few posts about floor/ceil etc.
If floor(x)=intg(x) , why not ceil(x)=-intg(-x) ?
Ain't it easier than ifs/piecewise in any form?
Would a DFT/IDFT (operating on lists) be useful for a library?
Maybe for people using the EA200?
Regards,
Anna
#59
Posted 20 September 2004 - 12:35 AM
im still on & off working on the encryption program... also i add stuff by other programmers every now and then
mostly im wating for the release of the CP SDK to see how usefull the stdlib will be after that... still any suggestions/subbmissions are welcome
btw, the round() function rounds to a specific place, its seperate from the floor() and ceil() functions
#60
Posted 13 October 2004 - 11:01 PM
below is a list of new functions and descriptions:
registry related:
register(str): - registers a program, simplest way to use the registry. the programs folder is determined by the current folder when register() is called. all optional data is left empty when using this command. all registry functions return a 1 if sucsesfull so you can tell if a program has been registered if RTN=1. the program is already registered if RTN=0
modkey(str,str,str,{str array}): - can register or modify an existing registered program. pram1: name of the program (should always be exactly as it appears in the folder list) pram2: folder program is in (should always be exactly as it appears in the folder list) pram3: a string containing all variables that should be removed along with the program durring an uninstall, each should be seperated with a "," pram4: any extra data the programmer would like to store in the registry, this should be stored as an array of strings to avoid problems.
unreg(str): - unregisters a program, exact opposite of register().
regdel(str): - dont get this confused with unreg(), regdel() uninstalls a program and all of its components from the classpad, then removed its registry entry.
REGEDIT(): - a tool for editing the registry, it can also preform system regressions.
non-registry:
parse(str,char): - takes string and turns it into a list, <char> is the character that each cell is split by (think split() in vb.net)
a few more details comming later
#61
Posted 14 October 2004 - 12:25 AM
Besides, I think that "parse" isn't a good name, "split" could be but in PHP's split() function, the separator is a regex, so "explode" is the best I think.
#62
Posted 14 October 2004 - 12:46 AM
ok, i'll rename it
#63
Posted 14 October 2004 - 01:09 AM
#64
Posted 14 October 2004 - 01:29 AM
StrJoin "{",str,str
StrJoin str,"}",str
strToExp(str)=>array
its very handy
#65
Posted 14 October 2004 - 02:30 AM
more details:
* isdef() has been modified to reduce the occurance of a tiny bug, now it will occure even less. this is caused when a isdef() is called with a variable that it uses locally, such a variable is always found to exist. the problem was corrected by making all local variables in isdef() (and a few other programs) end with "_"
* call() offically added to the library.
* for the first time the stdlib.mcs file contains more than just the library and main folders, now there is a registry folder that contains REGEDIT(), this folder IS MANDATORY, but REGEDIT() is not. if you forget to put the registry folder on your classpad and/or dont want REGEDIT() then any of the registry functions will automatically create the registry folder and intialize the registry file system if needed.
enjoy, and start upgrading those programs to work with the registry
btw: dont try to register anything in the library folder, nothing in there should need to be registered and it wont work anyway. also, only register main programs, not subprograms... subprograms should be listed as dependant files and should not have their own registry keys.
btw2: dependant files can be any data type, not just programs
#66
Posted 19 December 2004 - 06:53 PM
whats the syntax? and how to use?
#67
Posted 20 December 2004 - 04:12 AM
waitpen can be used it two ways:
waitpen("var_name") //the x and y coord of the pen will be stored in var_name (in array format)
or
waitpen({x1,y1,x2,y2}) //where the array contains the area you want to be pressed
waitpen() is used to wait for a pen touch, its a little more effective than using:
Do
Wait
GetPen x,y
LpWhile x=0 And y=0
plus it has the option of being used to create a button. it does however pause execution where GetPen does not.
#68
Posted 07 June 2005 - 08:34 AM
closegph() : Closes the Graph window return type : NONE xmin->xmin
It is very simple, no ? Try it, that will be great to force closing the Graph window
#69
Posted 07 June 2005 - 10:11 AM
#70
Posted 03 August 2005 - 10:00 AM
Furthermore, a program can accept input prameters, but cannot change them, unless they are "global". If they are local to the calling program, the changes are lost when control is returned to the calling program (without any warning!). Therefore, you cannot write a progam that plays the role of a function, unless you use "global" variables. This method has a huge drawback: The current folder is messed up with variables that are not used anymore, so you should delete them by hand or by using the DelVar command. I personally refuse to call this "programming"!
There are also many other poor features in this basic language, such as the strange string manipulation (it uses commands instead of functions!), but these can be overpassed. However, the lack of function definitions makes this basic "language" almost unusable. You cannot do serious programming in this environment!
I don't want to be offensive, but ClassPad's basic is so poor that makes this project meaningless. The project tries to upgrade the languge by adding basic programs! This is probably the reason that the posts in the forum are too few.
I like ClassPad, but not for its basic: it definitely needs an UPGRADE. The only solution is A NEW OS VERSION WITH A MUCH BETTER BASIC. Otherwise, its basic is not a programming language. POINT.
On the other hand, ClassPad's basic has a unique feature: it fully supports the CAS. This permits to write basic programs that make use of CAS statements. So, by writing a basic program, one can use the CAS much more efficiently than in the "Main" application . It is a pity that such a unique feature is practically useless, just because function definition is so primitive.
#71
Posted 25 August 2005 - 05:30 PM
P.S. I hope that PAP understood that ClassPad Basic is much more powerful than the previous versions of Casio Basic. Any Casio user should be delighted by this!
#72
Posted 26 August 2005 - 09:20 AM
Really? Have you ever tried some integrals in ClassPad? Probably not, because if you do, you will easily realize that the CAS is far from being perfect. I'm afraid that the all the competitors have a more powerful CAS. ClassPad's CAS is well integrated to the calculator, in the sense that ClassPad applications can use the CAS, but the CAS itself is not powerful at all.The implementation of the CAS and the rest of the ClassPad calculation capabilites is perfect.
Yes, I didn't bought all Casio calculators, and I'm not planning to do so. Is that serious? Do I have to buy every Casio calculator to "see the whole image"?However, this happens when an user like PAP (who obviously does not have any other graphic calculator from Casio) cannot see the whole image. I have all the best graphic calculators from Casio. Just take a look in their Basic and you will realize that the ClassPad R&D team was working very much on Basic.
The fact that ClassPad has a better basic than other Casio calculators is supposed to make me happy? Of course not! You say that Casio Basic has improved, and I assume that this is true. My answer is simple: SO WHAT? It's Casio's responsibility to upgrade its products, so a new version of the language must be better than the previous one. What I see is that ClassPad's basic (and CAS) has serious limitations. Shall I be "delighted" just because this basic is better than the previous versions?P.S. I hope that PAP understood that ClassPad Basic is much more powerful than the previous versions of Casio Basic. Any Casio user should be delighted by this!
No, I'm not happy with the current basic, given that function definition support is ridiculous, and that many things, such as string manipulation and statistical computations, are implemented as commands instead of functions. I'm not happy because these limitations still exist in OS 2.00, two years after the first version of the OS. I'm not pinned like you in Casio products. There are other calculators in the market, and if the basic and the OS will remain as they are now, I will be forced to buy a better calculator, leaving you (and others like you) being "delighted" by the basic and the "perfect" CAS.
#73 Guest_Guest_Kilburn_*_*
Posted 16 September 2005 - 07:39 PM
So you can have more powerful functions!
If you need help, go to the menu [?][ReadMe]
You can also view a sample program.
#74
Posted 16 September 2005 - 10:58 PM
I know that addin, it never worked on my CP. But, even if it works, I don't think that it really solves the problem (see posts for that in another topic). For me, as it is now, CP Basic is nothing. It is simply too poor, and almost unusable.Hmm... Try my addin PRGM Conv : it allows you to make functions with If, While, ... statements!
So you can have more powerful functions!
If you need help, go to the menu [?][ReadMe]
You can also view a sample program.
#75 Guest_Guest_Kilburn_*_*
Posted 17 September 2005 - 11:44 AM
I know that addin, it never worked on my CP. But, even if it works, I don't think that it really solves the problem (see posts for that in another topic). For me, as it is now, CP Basic is nothing. It is simply too poor, and almost unusable.
It never worked or you don't know how to use it ?
1-Write your program in the Program Editor
2-Launch PRGM Conv
3-Click on Import Program button (the first button on the toolbar)
4-Choose your program
5-Click on Export Function button (the second button on the toolbar)
6-Type the name of your function
7-Tap OK Button
8-Move the function created in the library folder
If your function doesn't work, you could have not respected the rules I wrote in ReadMe.
This program works on my CP, I never had problems...
I would like to give you the functions I've created, but I can't because I don't know how to include a file in a post.
But you are right, the CP Basic is really poor!
#76
Posted 17 September 2005 - 12:39 PM
This is why there is now an interesting alternativeBut you are right, the CP Basic is really poor!
#77
Posted 17 September 2005 - 06:32 PM
I can read the documentation you provide, and I'm not new in computers . I have followed the steps, trying to convert a very simple program into a function. It didn't worked as expected. Maybe I'm doing something wrong, I don't know, and, to be honest, I don't really want to know; the reason is simple: even if it works, your Add-In is not the solution to the problem. I think you know why.It never worked or you don't know how to use it ?
No offense, but I suspect that your Add-In simply changes a "PGRM" file to "FUNC", I don't know how exactly it does that, maybe it changes the header of the file, or something similar. Whatever your Add-In does, the result is not satisfactory at all. There are many limitations, concerning the "function" you can create this way: you can only use a few Basic commands, plus this "function" cannot call itself, i.e., no recursion. Furthermore, exiting to the menu, running your Add-In, then returning to the "Program" application to continue programming is a headache, especially during debugging the "function" you created. I'm putting the word "function" between quotation marks because this is not a real function, your Add-In makes it to mimic the behavior of a function, that's all.
I'm blaming you, at least you tried to do something to upgrade CP Basic somehow. Nice try, it's better than nothing, the functions that can be written using your Add-In are more complex than one command. But the fact is that function support in CP Basic remains extremely poor with or without your Add-In.
If you need an lternative, try CPLua; you will never want to write a program in CP Basic again. It's much faster than CP Basic, and you can write really complex programs without limitations.But you are right, the CP Basic is really poor!
#78
Posted 17 September 2005 - 07:21 PM
Actually Kilburn is already using it I can't wait for him to show me the CPLua programs he madeIf you need an lternative, try CPLua; you will never want to write a program in CP Basic again. It's much faster than CP Basic, and you can write really complex programs without limitations.
#79
Posted 17 September 2005 - 07:48 PM
He uses it, and he is so good? It's time to give a hand on testing then.Actually Kilburn is already using it I can't wait for him to show me the CPLua programs he made
#80
Posted 18 September 2005 - 06:33 PM
I can read the documentation you provide, and I'm not new in computers
So I am not so bad in English !
Actually Kilburn is already using it I can't wait for him to show me the CPLua programs he made
So here they are My Lua Programs
The comments are in French... Sorry!
I you need a translate, you can ask me... or Orwell : he speaks French very good!
There are some screenshots:
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users