Shop OBEX P1 Docs P2 Docs Learn Events
Question about binary — Parallax Forums

Question about binary

KraZe_EyEKraZe_EyE Posts: 15
edited 2008-11-13 19:21 in BASIC Stamp
Hi i'll make this quick.

When I use

DEBUGIN BIN5 testvar

I am trying to input a 4 digit binary number ie 1001, when I tried to do this with BIN4 I would input 4 numbers but it would only save 3 of them.
Which is why I changed it to BIN5, the thing is it seems I have to place a leading 1 or 0 THEN input my 4 digit number.

Why is this? And will using BIN5 screw up my use of OUTC? OUTC is 4 digits while i'm inputting a "supposedly" 5 digit number.

like OUTC = testvar

Whats the right way to do this?

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-11-13 19:21
    Hi, BIN4 should work, have you tried a small test program such as

    testvar VAR Byte

    main:

    DEBUGIN BIN4 testvar

    OUTC=testvar

    DEBUG BIN4 OUTC,CR

    PAUSE 300

    GOTO main

    Jeff T.

    EDIT sorry testvar would be better declared a nib

    Post Edited (Unsoundcode) : 11/13/2008 7:30:09 PM GMT
Sign In or Register to comment.