I made some changes in your code and it is compiling without errors.
I think you forgot the word "define" and used the word "print" instead of "debug"
(you could use serout or lcdout if you use a lcd)
I also changed the "dim" and changed the variable to v.
I hope this will help you a step forward.
' Receive values serially and timeout if no reception after 1 second (1000ms).
'DEVICE 16F877
'XTAL = 4
define osc 4
define HSERIAL_BAUD = 9600 ' Set baud rate to 9600
define HSERIAL_RCSTA = %10010000 ' Enable serial port and continuous receive
define HSERIAL_TXSTA = %00100000 ' Enable transmit and asynchronous mode
define HSERIAL_CLEAR = ON ' Optionally clear the buffer before receiving
' changed VAR1 ==> v
v var WORD 'var1
Loop:
HSERIN 1000, Timeout,[v]', '[Modifiers , Variable {, Variable... }] ' Receive a byte serially into VAR1 ==>line 23
debug DEC v , " " ' Display the byte received
GOTO Loop ' Loop forever
Timeout:
CLS
debug "TIMED OUT" ' Display an error if HSERIN timed out
STOP
END
'ERROR [line 23] : Value Expected! (sample.bas)