.a and .u

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: .a and .u

Post by Trond »

Thorium wrote:
freak wrote:Nobody forces you to use that structure. You can create your own and name it whatever you want.
It would still have a .a datatype in it.

Code: Select all

Structure Ubyte
  b.a
EndStructure

Procedure.i IsHooked(Module.s, Function.s)
  
  Protected Lib.i
  Protected *FuncAddr.Ubyte
  
  Lib = OpenLibrary(#PB_Any, Module)
  *FuncAddr = GetFunction(Lib, Function)
  CloseLibrary(Lib)
  
  If *FuncAddr <> 0
    
    If *FuncAddr\b = $E9 ; B!!!!!
      ProcedureReturn #True
    Else
      ProcedureReturn #False
    EndIf
    
  EndIf
  
EndProcedure
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: .a and .u

Post by Thorium »

Yes, and?
It still has the .a datatype in it. So i am just ending up like on C and define names for things that are all the same and make the code less portable (have to ship the structures with code snippets) and i think the logic is just bad. Ascii is logicaly not a basic data typ, it would be much more logical do call it a unsignt byte: .ub
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: .a and .u

Post by Fred »

It's your opinion, and we respect it. Please respect our as well, it's not going to change. Ascii and Unicode as unsigned byte and word are perfectly valid and makes sens in many situation where you are dealing with characters. We won't duplicate these types to call them .ub or .uw. Now the more important is than your have these unsigned types available, so what about getting back to code ?
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: .a and .u

Post by Thorium »

Fred wrote: Please respect our as well, it's not going to change.
I do respect it, and it's no reason for me to not use PureBasic. But as long as it's allowed to discuss it, i will. ^^
User_Russian
Addict
Addict
Posts: 1517
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: .a and .u

Post by User_Russian »

Good topic.
At the moment, not enough of Unsigned Long and Integer.
For example, to compare the two IPv4 addresses, we have to use variables such as Quad, although it is enough to Unsigned Long.
Such examples are many.
User_Russian
Addict
Addict
Posts: 1517
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: .a and .u

Post by User_Russian »

The next version is planned to add unsigned variables Long and Integer?

If not, then at least add the function or macro (like Bool), which allows to compare the signed variables as unsigned. As well necessary to solve the problem with a shift.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: .a and .u

Post by BorisTheOld »

User_Russian wrote:If not, then at least add the function or macro (like Bool), which allows to compare the signed variables as unsigned. As well necessary to solve the problem with a shift.
We get around the problem of missing features in PB by using the features of FreeBasic. We pass the data to a small FB module, do the appropriate processing, then return the results to the PB code.

The technique works well and is easy to implement.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: .a and .u

Post by blueznl »

Might make sense, but perhaps might not. Could you give an example of the thing you couldn't do in PureBasic?
( 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... )
Post Reply