The following code
Code: Select all
program text_test
dim msg as string[79]
main:
msg = "Result is" '+ ' Text "Result is"
StrAppendsuf(msg,chr(13)) '+ ' Append CR (carriage return))
StrAppendSuf (msg,Chr(10)) '+ ' Append LF (linefeed)
StrAppendsuf (msg,".") ' Append a dot
end.
Code: Select all
^text_test.pbas, 9 :: StrAppendsuf(msg,chr(13)) '+ ' Append CR (carriage return))
$0041 $3020 MOVLW main_global_msg
$0042 $1683 BSF STATUS, RP0
$0043 $00A0 MOVWF FARG_strAppendSuf
$0044 $300D MOVLW 13
$0045 $00A1 MOVWF FARG_strAppendSuf+1
$0046 $2017 CALL strappendsuf_strappendsuf
^text_test.pbas, 10 :: StrAppendSuf (msg,Chr(10)) '+ ' Append LF (linefeed)
$0047 $3020 MOVLW main_global_msg
$0048 $00A0 MOVWF FARG_strAppendSuf
$0049 $300D MOVLW 13 ' this should be 10 .. ???
$004A $00A1 MOVWF FARG_strAppendSuf+1
$004B $2017 CALL strappendsuf_strappendsuf
^text_test.pbas, 11 :: StrAppendsuf (msg,".") ' Append a dot
$004C $3020 MOVLW main_global_msg
$004D $00A0 MOVWF FARG_strAppendSuf
$004E $302E MOVLW 46
$004F $00A1 MOVWF FARG_strAppendSuf+1
$0050 $2017 CALL strappendsuf_strappendsuf
$0051 $ text_test_L_0:
$0051 $2851 GOTO $
If we take the whole of the program from the mB general post.. using strappendsuf ..
Code: Select all
program text_test
dim msg as string[79]
dim res_txt as string[5]
dim res, channel as word
dim crlf as string[2]
main:
crlf[0]=13 'initialise crlf as CR,LF,null
crlf[1]=10
crlf[2]=0
res = Adc_Read(channel) ' Get result of ADC
WordToStr(res, res_txt) ' Create string out of numeric result
' Prepare message for output
msg = "Result is" '+ ' Text "Result is"
StrAppendsuf(msg,Chr(13)) '+ ' Append CR (carriage return))
Strappendsuf (msg,Chr(10)) '+ ' Append LF (linefeed)
' strcat(msg,crlf) ' append crlf string
Strcat (msg,res_txt) '+ ' Result of ADC
Strappendsuf (msg, ".") ' Append a dot
end.
Code: Select all
^text_test.pbas, 19 :: StrAppendsuf(msg,Chr(13)) '+ ' Append CR (carriage return))
$014C $30A0 MOVLW main_global_msg
$014D $1283 BCF STATUS, RP0
$014E $00AD MOVWF FARG_strAppendSuf
$014F $01AE CLRF FARG_strAppendSuf+1, 1
$0150 $20DA CALL strappendsuf_strappendsuf
^text_test.pbas, 20 :: Strappendsuf (msg,Chr(10)) '+ ' Append LF (linefeed)
$0151 $30A0 MOVLW main_global_msg
$0152 $00AD MOVWF FARG_strAppendSuf
$0153 $01AE CLRF FARG_strAppendSuf+1, 1
$0154 $20DA CALL strappendsuf_strappendsuf
Workaround?
Insist on only using character eg "x" for strappendsuf/strappendpre ..
or use strcat