Page 1 of 3

[Implemented] Modulo

Posted: Mon Jan 23, 2006 12:48 am
by Brujah
A function that I miss in purebasic is Modulo.
This would make it easier to change something for example every 5 levels.
I know that there are easy solutions to this problem. And I integrated one of them already. But it would still be cool if purebasic had this command!

Posted: Mon Jan 23, 2006 12:50 am
by blueznl
% % %

Posted: Mon Jan 23, 2006 9:42 am
by Kale
Image

Posted: Mon Jan 23, 2006 9:52 am
by Psychophanta
Kale wrote:Image
Read This Fantastic Manual
:wink:

Posted: Mon Jan 23, 2006 12:37 pm
by blueznl
i still think i'd like a keyword like Mod() or Mod and Div() or Div and (whilte we're at it) i could do with a little ^ as well...

:-)

Posted: Mon Jan 23, 2006 6:25 pm
by aaron
I was thinking that instead of +, we should use PLUS and = could be EQUAL. And then maybe all the numbers could be spelt out too...

a EQUALS LEFT BRACKET LEFT BRACKET a PLUS ONE RIGHT BRACKET MOD 2 RIGHT BRACKET MULTIPLY SEVEN

:P

Just kidding.

Posted: Mon Jan 23, 2006 6:40 pm
by Killswitch
We can't already do that? :(

Posted: Mon Jan 23, 2006 9:41 pm
by Num3
Sure ya can....

Use Macros ;)

Code: Select all

!macro PLUS
!{
+
!} 
:twisted:

Posted: Wed Jan 25, 2006 5:23 am
by chris319
aaron wrote:I was thinking that instead of +, we should use PLUS and = could be EQUAL. And then maybe all the numbers could be spelt out too...

a EQUALS LEFT BRACKET LEFT BRACKET a PLUS ONE RIGHT BRACKET MOD 2 RIGHT BRACKET MULTIPLY SEVEN

:P

Just kidding.
You already have POW, so why not?

Not kidding.

Posted: Wed Jan 25, 2006 9:24 am
by blueznl
hate pow() want ^ hate % want mod()

okay, okay, stop shouting at me, i'm an old gfa user :-)

Posted: Wed Jan 25, 2006 11:02 am
by Dare2
GFA is just a copycat of qBasic/Vb anyhow. :P :)

I also want ^ instead of Pow and Mod instead of %

And this is totally illogical, when you think on it. First swap a symbol for a keyword - but then swap a keyword for a symbol. We are so patterned! :)

Posted: Wed Jan 25, 2006 11:23 am
by blueznl
dare to say that it aint a copycat :-) (actually, gfa predates vb, so :-))

but yes, you are right, it's what we are used to, i guess...

Posted: Wed Jan 25, 2006 12:52 pm
by MikeB
I used GFA and then Blitz on an Amiga before going over to assembly language which was the only way to gain control of the machine. When I first got a PC with windows I found assembly language far too complicated and tried Blitz, which I found more suited to games than the applications which is what I wanted. I then tried PB and found it to be ideal, I could understand it and it was quite fast enough for most things. However I can't stop thinking of the previous languages and I am always typing "^" for a power and wondering why I then get an error, (likewise "strip" instead of "trim" etc.). :?
By the way my major want in PB is, as a lot of others want, greater precision maths, the higher the better :D
At the moment I use the Eval("") procedure by Tejon which is brilliant, but a bit cumbersome as you have to use strings. The results however cannot be faulted :D
I have great hopes for V4, but I seem to have waiting so long that I sometimes wonder if it's ever coming! :wink:

Posted: Wed Jan 25, 2006 3:05 pm
by blueznl
MikeB wrote: I have great hopes for V4, but I seem to have waiting so long that I sometimes wonder if it's ever coming! :wink:
it's never going to be what everyone expects but i sneaked into fred's basement and it looked promising!

viewtopic.php?p=121139#121139

Posted: Wed Jan 25, 2006 3:21 pm
by Dare2
That's nice. But we're not really interested in his basement.