Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub TypeText2 (Text as zString Ptr)
- Dim as Integer X = 1
- For CharNum as Integer = 0 To Len(*Text)-1
- pCon.Lock()
- ' When we come to a space
- If Text[CharNum] = 32 Then
- ' Check if the next word's length is longer
- ' than the remaining screen space
- If X+Instr(CharNum, *Text, Chr(32))-CharNum >= SCREEN_WIDTH-2 Then
- ' If it is, go to the start of the next line
- TextRow += 1: X = 1
- Else
- ' Otherwise just advance the cursor over the space
- X += 1
- End If
- ' Parse any newlines
- ElseIf Text[CharNum] = Asc(!"\n") Then
- TextRow += 1: X = 1
- ' Ignore \r if we hit it
- ElseIf Text[CharNum] <> Asc(!"\r") Then
- ' Print the next character and advance the cursor
- CharPtr(X, TextRow) = Text[CharNum]
- X += 1
- End If
- pCon.Unlock()
- Sleep 25,1
- Next CharNum
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement