Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic - I am lost — Parallax Forums

PropBasic - I am lost

camelot2camelot2 Posts: 54
edited 2011-11-10 05:10 in Propeller 1
I am trying to multiply 3x10 and display the result
on the serial terminal included in BST. What gets
displayed is 6 !!! Can someone please tell me what
I am doing wrong? thanks for your help

I am using BST ver 0.19.3 and PropBasic ver 1.14
This is my program:

DEVICE P8X32A, XTAL1, PLL16X
XIN 5_000_000

BAUD CON "T115200" ' Baud rate for PC communications

TX PIN 30 HIGH ' Output pin for PC communications

ascii HUB STRING(20)

ans VAR LONG

PROGRAM Start

Start:
ans = 3 * 10
ascii = STR ans,10,1
SEROUT TX, BAUD, ascii ' Send to terminal
END

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-11-09 15:39
    IIRC there is/was a bug re: multiply with constants. It helps when you place your values in variables first (worked for me on 00.01.14). For some reasons I can't run the later versions of PropBasic so I don't know if this has been fixed.
  • BeanBean Posts: 8,129
    edited 2011-11-10 05:10
    camelot2,
    Yes there is bug in the multiply of older versions of PropBasic.
    I recommend using PropBasic for Viewport from this thread http://forums.parallax.com/showthread.php?135678
    Using Viewport as the IDE allows me make changes to the compiler without having to have someone else integrate them (like BST does).

    Bean
Sign In or Register to comment.