Shop OBEX P1 Docs P2 Docs Learn Events
Parenthases — Parallax Forums

Parenthases

sv806sv806 Posts: 14
edited 2007-04-25 03:36 in BASIC Stamp
a couple codes i found in the help file for pbasic, i was wondering if the ( ) are needed in the first code? and what is bin1 in7, CR do?

Setup:
  INPUT 4

Hold:
  IF (IN4 = 0) THEN Hold                        ' Stay here until P4 is 1



Main:
  INPUT 7                               ' Make P7 an input
  DEBUG "State of P7: ",
        BIN1 IN7, CR

  OUT7 = 0                              ' Write 0 to output latch
  DEBUG "After 0 written to OUT7: ",
        BIN1 IN7, CR

  OUTPUT 7                              ' Make P7 an output
  DEBUG "After P7 changed to output: ",
        BIN1 IN7
  END

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-04-25 02:46
    BIN1 IN7, CR is part of the debug statement above it. DEBUG outputs data to the computer on the serial port in this case it prints "State of P7: <binary value of pin7> <carrige return>
    IN7 is the input value of pin7

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • sv806sv806 Posts: 14
    edited 2007-04-25 03:03
    thank you...now to see if those parenthases are required
  • curious1curious1 Posts: 104
    edited 2007-04-25 03:36
    Syntax and ref. man.· Page 128

    not necessary for pbasic 2.0 and 2.5

    Used within an expression will change the order of evaluation. i.e. math problems.

    RC
Sign In or Register to comment.