[Implemented] Modulo

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

[Implemented] Modulo

Post 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!
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

% % %
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Image
--Kale

Image
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Kale wrote:Image
Read This Fantastic Manual
:wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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...

:-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
aaron
Enthusiast
Enthusiast
Posts: 267
Joined: Mon Apr 19, 2004 3:04 am
Location: Canada
Contact:

Post 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.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

We can't already do that? :(
~I see one problem with your reasoning: the fact is thats not a chicken~
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Sure ya can....

Use Macros ;)

Code: Select all

!macro PLUS
!{
+
!} 
:twisted:
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post 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.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hate pow() want ^ hate % want mod()

okay, okay, stop shouting at me, i'm an old gfa user :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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! :)
@}--`--,-- A rose by any other name ..
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
MikeB
Enthusiast
Enthusiast
Posts: 183
Joined: Sun Apr 27, 2003 8:39 pm
Location: Cornwall UK

Post 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:
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

That's nice. But we're not really interested in his basement.
@}--`--,-- A rose by any other name ..
Post Reply