Modulus, Else If and some other comments
-
Modulus doesn't seem to have a %= counterpart, so:
num += 1 // Works num %= 5 // Error with "unexpected =" num = num % 5 // Works
Is this an intentional omission?
I'm also wondering if there's any intention on improving complex program flow.
Since there's no equivalent to a switch() (or CASE as it was in BBC BASIC, from long ago) and there's no implicit Else If, then things can look fairly messy.If condition Then foo() Else If condition2 Then bar() Else If condition3 Then foobar() EndIf EndIf EndIf
Unless I've missed something and there's a neater way?
Lastly, is there any way of adding some quicker movement around the editor? Something like control left/right for moving between words.
-
@Mincus IIRC, all these things have been covered in the wish list thread.
Here's what I do as a replacement of a case statement:
while true loop // A "one-pass" loop if condition then foo() break endif if condition2 then bar() break endif if condition3 then foobar() break endif break repeat
-
@Mincus There doesn't seem to be anything in the pipeline at the moment but I am sure there will be a switch statement added at some point
-
Looking through the Wishlist thread (I should have done that first, my apologies, but it is long!) the Modulus hasn't been addressed.
Using if statements in a list like that isn't great if your conditions are all checking the same variable, but there were some posts indicating we will get a switch() equivalent at some point.
And I guess I'm just adding my voice to the list for more options to move around a file. Spending 30+ seconds holding left/right cursor keys isn't much fun! -
@Mincus %= looks like an omission to me I will raise an issue
-
@Mincus Beside the pos1 and end keys, I started to use the control pad (or "directional button") more. Especially for selection and afterwards deleting of one line.
-
@spikey Does the keypad do something special? I'm using a keypad-less keyboard, but I use the page up/down/home/end keys all the time.
The problem is when you need to do something in the middle of a 200 character line.
Maybe I should be making my lines shorter. -
@Mincus sry, meant "control pad" on the controller not key pad.
Moving the cursor with the controller moves it quicker after a few moments of pressing itand I like the copy/paste (instead of using the keyboard). -
Found another instance of mod not being implemented:
If you do Vector % Vector you get an 'operation not recognized' error (Details: vector, modulo, vector)
For instancev = { 20, 25 } vmax = { 20, 20 } v = v % vmax
As a note to why I'm using these, it's the easiest way to manage screen wrapping in my Asteroids clone.
-
@Mincus sorry, was wrong about that. It just accelerates viewing not the cursor.