PDA

View Full Version : PropBasic - I am lost



camelot2
11-09-2011, 05:18 PM
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

kuroneko
11-09-2011, 10:39 PM
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.

Bean
11-10-2011, 12:10 PM
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