Re: String or Numeric Variable?




"ProfitMaxTrading.com" <nospam@xxxxxxxxxx> wrote in message
news:bDL8f.4196$LR1.2319@xxxxxxxxxxxxx
> What I believe you are referring to is Zero-Extension or Sign-Extension. A
> 1-byte value such as &H7F thus becomes &H007F or &H0000007F, etc.?
>
> Then this begs another question.
>
> 1. Why bother even having a BYTE type, or an INTEGER type?
>

I would use these two types primarily when external factors require it.
Some VB and Windows functions take Integers, not Longs, i.e. the VB graphic
functions.
Byte arrays are frequently used to process chunks of binary data, such as
bitmaps and OLE objects, where byte level access is needed.

IF you have a large array, say 100K or more, then it might make sense to use
shorter integer types. Even then, you can pack a long with several values,
writing some methods to get at the individual values. I have done this with 32
1-bit flags in a long, for instance, when each element of the array needed its
own set of flags.



.



Relevant Pages

  • Re: strcpy - my implementation
    ... Since you're initialising an array of integers, ... If the type were non-integer (e.g. pointer, or floating point, or struct ... integer type can safely be initialized with memset, ...
    (comp.lang.c)
  • Re: how to "put" a binary structure? (newbie question!)
    ... I'm a newbie to Ada programming and> therefore please excuse if my question might be silly or stupid. ... Array of bits, like array of Boolean or of Bit_T ... Modular integer type mod 2**8, Unsigned_8> How can I correct the source code to print the values stored in the> structure Xxx? ...
    (comp.lang.ada)
  • Re: Address of an array = address of its 1st element: undecidable question ?
    ... integer type is a subrange of the corresponding ... as well be interpreted as an array of two shorts or an array ... But a reasonable extension of the standard's definition of "value" ...
    (comp.lang.c)
  • Re: Type of argc
    ... I think I'll have to quote older posts: ... provides any benefits over any other integer type, signed or unsigned, ... With size_t, this cannot be the case, because, the size of the array of char* must be smaller or equal to SIZE_MAX. ...
    (comp.std.c)
  • Re: [PATCH 1/2] Implement %pR to print struct resource content
    ... + * addresses (not the name nor the flags) ... small dtail: could you please also add the information that this is ... about the kernel-special resource_size_t integer type? ... It's a "struct resource" pointer, ...
    (Linux-Kernel)