? PUSH/UNSHIFT on uninitialized strings in arrays. (Page 1) ● SmileBASIC Source Forums

Sign In

*Usernames are case-sensitive
Forgot my password

PUSH/UNSHIFT on uninitialized strings in arrays.

  • #1 ✎ 1662 12Me21 Head Admin Third Year My account is over 3 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself This does not work: DIM A$[1] PUSH A$[0],"!" But this does: DIM A$[1] A$[0]="" PUSH A$[0],"!" And this: DIM A$[1] INC A$[0],"!" Posted
  • #2 ✎ 198 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies COPY seems to do it too. During my fiddling, I found that RINGCOPY doesn't treat strings as arrays like PUSH, UNSHIFT, COPY, yadda yadda do. DIM A$[1] COPY A$[0],0,"!" 'Works fine RINGCOPY A$[0],0,"!" 'Type Mismatch Error Wonder why. Also, I used to work with strings a lot when I began learning SB. I wonder how this bug went unnoticed for so long and how much my virgin programmer self has suffered because of it. Edit: didn't take me long to find out why RINGCOPY is different, it simply doesn't allow strings, which is odd because that doesn't seem to be mentioned in its manual page. I get that it's for Sound Processing though, it's just not explicit in the documentation that the function doesn't work on string arrays. Posted Edited by MZ952