? Appearing Text, letter by letter, without CLS ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Appearing Text, letter by letter, without CLS

A very simple way to make a text appear, letter by letter. There other ways to do the same thing, but this is without CLS, that can lead to the disappearance of other texts. TEXT$="Test" P$=0 V=0 WHILE LEN(TEXT$)>V A$=MID$(TEXT$,V,1) P$=P$+A$ LOCATE 0,0:PRINT P$ V=V+1 WAIT 5'This delay changes the speed of the text. WEND You can use this multiple times simply by copying it! Hope this can be useful : )
Author
Stefano_Lassandro
Updated
Rating
1 vote
Categories
Keywords
  • Text
6 Comment(s) Yttria Yttria Since you're using WAIT, I think it's safe to assume no other code is running when this is called DEF SLOWPRINT TEXT$, DELAY%, SKIPWS VAR I%, C$ VAR L% = LEN(TEXT$)-1 FOR I%=0 TO L% C$ = TEXT$[I%] ?C$; '? = PRINT, ; = no newline 'skip delay on whitespace IF C$<=" "*SKIPWS THEN @no_delay WAIT DELAY% @no_delay NEXT END SLOWPRINT "Test", 5, FALSE S_DE_Solutions S_DE_Solutions Avatar Block I didn't change my avatar for 30 days. Website Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Please check this code, it is buged. In best case (with correct lines end End after Return) it will only show: [folder]OK without printing Thanks for update. (I still dont know, why C$ = TEXT$[I%] is working without using MID$ Yttria Yttria Sorry about that; ?P$; -> ?C$; corrected Stefano_Lassandro Stefano_Lassandro Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Minecraft Is Awesome! I love Minecraft! Express Yourself Thank you Yttria Yttria In many languages, strings are just char arrays or a thin wrapper over an array. In SmileBASIC, they are distinct, but for convenience, some array operations are extended to work on strings, including PUSH, POP, UNSHIFT, SHIFT Additionally, the array subscript operator [ ] is defined for strings: 1. Consider the string T$ 2. Let MID$(T$,i,n) denote the substring starting at position i and ending n characters later in T$ 3. Then MID$(T$,i,1) is the ith symbol of string T$ and 4. is equivalent to the notation T$[i] for 0 ≤ i < LEN(T$) For i < 0, MID$() is undefined and throws Out of range, and T$[i] throws Subscript out of range For iLEN(T$), MID$() returns the empty string (as for any part of a substring past the string length), and T$[i] throws Subscript out of range T$[i] is a valid left-hand side. Let T$ be a string with a length n > 0, Let S$ be an arbitrary string with length m, Then T$[i] = S$is T$=MID$(T$,0,i) + S$ + MID$(T$,i+1,n-i)or T$0,...,T$i-1, S$0,...,S$m-1, T$i+1,...,T$n-1 So for T$="ABCDEF" T$[3] = "WWW" 'T$ == "ABCWWWEF"and T$[3] = "" 'T$ == "ABCEF" S_DE_Solutions S_DE_Solutions Avatar Block I didn't change my avatar for 30 days. Website Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Thank's for your update Yttria. It's realy interessting and good to know. (That can make code much smaler.)