[Include] DBits - 16-bit and 8-bit arrays support.
#1

[Include] DBits 1.1
> created by MrDeath537



Introduction:
This include allow us to create 16 and 8 bit arrays, you've to download it and put on "pawno\includes\" then include it on your script as:
pawn Код:
#include <DBits>


Creating variables:
Use the following syntax:
Код:
new
    Bit16:variable<size>,
    Bit8:variable<size>;

Functions:
  • Bit8_Get(variable[], slot):
    Returns the value of the specified slot on the variable.
  • Bit8_Set(variable[], slot, value):
    Sets the value of the specified slot on the variable.
  • Bit16_Get(variable[], slot):
    Returns the value of the specified slot on the variable.
  • Bit16_Set(variable[], slot, value):
    Sets the value of the specified slot on the variable.


Posible uses:
The main usage would be saving memory, why should you waste the double memory (if you need 16-bit variables) or the quadruple (if you need 8-bit variables) if you can use the right one and save memory?



Limits:
8-bits, maximum variable size: 256.
16-bits, maximum variable size: 65536.



Notes:
- It's impossible to create a single 8-bit or 16-bit variable, but not arrays, because this include uses "normal" variables.
- The 8-bit variables uses char-arrays.
- I did some tests and I didn't find any bug, please tell me if you find one.



Download:
Pastebin - First release
Pastebin - Update 1.1
Reply


Messages In This Thread
DBits - 16-bit and 8-bit arrays support. - by MrDeath537 - 14.06.2011, 11:26
Re: DBits - 16-bit and 8-bit arrays support. - by SpiderWalk - 14.06.2011, 11:41
Re: DBits - 16-bit and 8-bit arrays support. - by Edvin - 14.06.2011, 11:44
Re: DBits - 16-bit and 8-bit arrays support. - by Mr.GeEk - 14.06.2011, 12:07
Re: DBits - 16-bit and 8-bit arrays support. - by tarmo - 14.06.2011, 12:25
Re: DBits - 16-bit and 8-bit arrays support. - by Anzipane! - 14.06.2011, 13:07
Re: DBits - 16-bit and 8-bit arrays support. - by Double-O-Seven - 14.06.2011, 13:08
Re: DBits - 16-bit and 8-bit arrays support. - by Anzipane! - 14.06.2011, 13:11
Re: DBits - 16-bit and 8-bit arrays support. - by MrDeath537 - 14.06.2011, 13:22
Re: DBits - 16-bit and 8-bit arrays support. - by MrDeath537 - 14.06.2011, 13:46
Re: DBits - 16-bit and 8-bit arrays support. - by Double-O-Seven - 14.06.2011, 13:54
Re: DBits - 16-bit and 8-bit arrays support. - by ylleron - 14.06.2011, 14:20
Re: DBits - 16-bit and 8-bit arrays support. - by MrDeath537 - 14.06.2011, 14:23
Re: DBits - 16-bit and 8-bit arrays support. - by Double-O-Seven - 14.06.2011, 14:29
Re: DBits - 16-bit and 8-bit arrays support. - by GangsTa_ - 14.06.2011, 15:56
Re: DBits - 16-bit and 8-bit arrays support. - by ZeQualX - 14.06.2011, 18:04
Re: DBits - 16-bit and 8-bit arrays support. - by MrDeath537 - 14.06.2011, 21:20
Re: DBits - 16-bit and 8-bit arrays support. - by Lorenc_ - 15.06.2011, 08:59
Re: DBits - 16-bit and 8-bit arrays support. - by leong124 - 15.06.2011, 09:21
Re: DBits - 16-bit and 8-bit arrays support. - by RyDeR` - 15.06.2011, 09:52
Re: DBits - 16-bit and 8-bit arrays support. - by leong124 - 15.06.2011, 11:59
AW: DBits - 16-bit and 8-bit arrays support. - by Forbidden - 15.06.2011, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)