"Sputnik" help  
Sputnik Help
SizeBytes(<sizeCode>)

Description

Calculates the number of bytes based on the specified size code.

Parameters

<sizeCode> The size code that represents the target size.

Return Value

Success: Returns the number of bytes for the specified size.
Failure: Returns null.

Remarks

The SizeBytes function calculates the number of bytes based on the specified size code. The size code is typically represented by constants such as @SizeCodeByte or @SizeCodeWord in Sputnik.

The internal implementation of the function calculates the value 1ul (unsigned long) by shifting it to the left by the number of positions represented by the size code. This results in the total number of bytes for the specified size.

Related

Example

Example of usage:

my $sizeCode = @SizeCodeByte;
my $mask = SizeBytes($sizeCode);
say $mask;

my $sizeCode = @SizeCodeWord;
my $mask = SizeBytes($sizeCode);
say $mask;

my $sizeCode = @SizeCodeDWord;
my $mask = SizeBytes($sizeCode);
say $mask;

my $sizeCode = @SizeCodeQWord;
my $mask = SizeBytes($sizeCode);
say $mask;

// PRINTS
// 1
// 2
// 4
// 8

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org