Shop OBEX P1 Docs P2 Docs Learn Events
console string — Parallax Forums

console string

Marz KrishnaMarz Krishna Posts: 26
edited 2009-06-27 21:38 in BASIC Stamp
How do i get a string from the console into an array.
the program i wrote would store a string of 11 characters, but i couldn't figure out how to get the ret key to stop the string. i see some wierd code for the ret, but i'm not sure i implimented it correctly, ultimately i just want to be able to use null terminated strings from the text console.
i was using the debugin command with \L \E (\CR) for the end character, but i couldn't get the input to terminate after the carriage return, and would have to keep typing empty characters until i had 11 characters.

Post Edited (Marz Krishna) : 6/27/2009 9:35:30 PM GMT

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-06-27 21:38
    Hi , you almost have it right , I think you misunderstood the end of string example. The "E" can be any character you want as a termination character. Below is an example with carriage return.
    x VAR Byte(11)
    main:
    DEBUGIN STR x\11\CR
    DEBUG STR x
    GOTO main
    

    Jeff T.
Sign In or Register to comment.