My Wish List
Posted: Fri Sep 17, 2004 7:36 pm
After eight years with GFA Basic and a flirtation with Power Basic, my considered short list of PB enhancements is currently as follows:
1. MAX and MIN
==========
I found that GFA's MAX and MIN were handy to limit ranges:
n = MAX(x,y) ; n gets the higher of x,y
x = MAX(x+2,MaxXValue) ; increases x by 2 with a limit
Nice, because optimised function shoud be very fast...
n = MAX(MyArray()) ; returns highest value in array
i = MAXARRAY(MyArray()) ; returns index of highest value
Similar for MIN( )
2. RANGE
======
RANGE might be handy:
Flag = RANGE(100,n,200) ; returns TRUE if n is between or at limits, else FALSE
3. CASE
=====
I have already requested that the CASE statement be improved, and sorry to bring it up again. I wrote a lot of code over the last few evenings and this would truly improve the language. I have an irrational hate of cascaded ElseIf...
CASE 1 TO 15
CASE 1,5,9,85
CASE 1 TO 15, 42 ; Because I just added another option!
4. WindowMouseX() = X
===============
Again, I mentioned this before, but its such a simple thing to add. A kind forum contributor pointed me at the solution, so my program works as I intended.
5. Colouring Buttons
=============
Again, thanks to a forum contributor for helping me get some buttons coloured properly. How about:
SetGadgetColor(#Gadget,RGB(r,g,b),Text/Background)
6. NON INTEGER INCREMENTS in FOR / NEXT / STEP
=================================
This was a nasty surprise for a new user! OK, I wrote the loop using Repeat/Until, but sometimes For/Next.
Looking back over the last week, I found work arounds for all the language features that I encountered. One of the most important words to remember is FORUM... thats where problems truly get solved... so why not put calls to the PB Website and MSDN on the menu? (Like Power Basic's SED editor.)
1. MAX and MIN
==========
I found that GFA's MAX and MIN were handy to limit ranges:
n = MAX(x,y) ; n gets the higher of x,y
x = MAX(x+2,MaxXValue) ; increases x by 2 with a limit
Nice, because optimised function shoud be very fast...
n = MAX(MyArray()) ; returns highest value in array
i = MAXARRAY(MyArray()) ; returns index of highest value
Similar for MIN( )
2. RANGE
======
RANGE might be handy:
Flag = RANGE(100,n,200) ; returns TRUE if n is between or at limits, else FALSE
3. CASE
=====
I have already requested that the CASE statement be improved, and sorry to bring it up again. I wrote a lot of code over the last few evenings and this would truly improve the language. I have an irrational hate of cascaded ElseIf...
CASE 1 TO 15
CASE 1,5,9,85
CASE 1 TO 15, 42 ; Because I just added another option!
4. WindowMouseX() = X
===============
Again, I mentioned this before, but its such a simple thing to add. A kind forum contributor pointed me at the solution, so my program works as I intended.
5. Colouring Buttons
=============
Again, thanks to a forum contributor for helping me get some buttons coloured properly. How about:
SetGadgetColor(#Gadget,RGB(r,g,b),Text/Background)
6. NON INTEGER INCREMENTS in FOR / NEXT / STEP
=================================
This was a nasty surprise for a new user! OK, I wrote the loop using Repeat/Until, but sometimes For/Next.
Looking back over the last week, I found work arounds for all the language features that I encountered. One of the most important words to remember is FORUM... thats where problems truly get solved... so why not put calls to the PB Website and MSDN on the menu? (Like Power Basic's SED editor.)