Announcement

Collapse
No announcement yet.

Assignment of Binary strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    Thanks much !!! ......

    TurboBoy

    ------------------
    when things old are new again...making fast cars faster with PBDOS......

    Leave a comment:


  • Lance Edmonds
    replied
    Don't forget Octal too:
    Code:
    PRINT &10, &O10, &q10 ' 10 Octal = 8 Decimal
    Oh, and adding a leading zero will force an unsigned evaluation...
    Code:
    PRINT &HFFFF, &H0FFFF, &HFFFF??
    ..Produces:
    Code:
    -1             65535         65535

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Mike Burns
    replied
    Prefix the number by the radix (&B for binary .. &H for hexadecimal
    It should be under Character Set in the DOS help file

    Switches = &b01110111

    Mike


    ------------------

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Assignment of Binary strings

    Assignment of Binary strings

    I want to set BYTE variables to certain binary values.

    ---
    DIM Switches AS BYTE

    Switches = b'01110111'
    ---
    I was just writing my code and could not find this in the ref
    books. Is this valid? If not, what is the best way. It makes
    my code easy to read if I can use binary rather than a character.

    Thanks,
    TurboBoy

    ------------------
    when things old are new again...making fast cars faster with PBDOS......
Working...
X