Shop OBEX P1 Docs P2 Docs Learn Events
Code Errors! — Parallax Forums

Code Errors!

willthiswork89willthiswork89 Posts: 359
edited 2006-08-12 15:34 in BASIC Stamp
this in the pbasic help file for serin

serStr VAR Byte(10) ' Make a 10-byte array Main: serString(9) = 0 ' Put 0 in last byte SERIN 1, 16468, [noparse][[/noparse]STR serStr\9\"!"] ' Input password string DEBUG "Waiting for: ", STR serString, CR SERIN 1, 16468, [noparse][[/noparse]WAITSTR serStr] ' Wait for the password DEBUG "Password accepted!", CR END··serStr VAR Byte(10) ' Make a 10-byte arrayMain: serStr(9) = 0 ' Put 0 in last byte SERIN 1, 16468, [noparse][[/noparse]STR serStr\9] ' Get 9-byte string DEBUG STR serString ' Display the string END·if you notice the bytes variable serStr then look there are a coupld instances where they use serSTRING instead·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-12 15:34
    Yup, looks like you caught a problem. This is why your code standard should say "ALWAYS abbreviate 'String' as 'Str', when using it as a suffix".
Sign In or Register to comment.