Unsigned vars and indices for all vars

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
hellhound66
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Feb 21, 2006 12:37 pm

Unsigned vars and indices for all vars

Post by hellhound66 »

Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:36 pm, edited 1 time in total.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

+1

Yes I also think these do really make sense.
Check out OOP support for PB here!
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Unsigned vars and indices for all vars

Post by Trond »

hellhound66 wrote: Fred posted, that there would be a casting problem. I say no. It is alway clear, what type a variable has, so it is clear, what castings need to be done.
Although I agree with the request, I still think there are some casting problems. What would you do about this? Convert ulong to a long or long to an ulong?

Code: Select all

ulong.ul = 4294966000
long.l = -10000
Debug ulong
Debug long

If ulong > long
  ; And we have a problem...
EndIf
hellhound66
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Feb 21, 2006 12:37 pm

Post by hellhound66 »

Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:36 pm, edited 1 time in total.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Or at quad (or perhaps any level) when signed -v- unsigned comparison, check the sign of the signed var.

If this is negative then the signed var will always be less than and unequal to.

If this is positive then convert signed var to unsigned and compare.

As the compiler knows what is what at compile time it can cut the per-case code.
Dare2 cut down to size
Post Reply