Advertisement
Mysoft

Untitled

Dec 4th, 2016
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Declare Sub UpdateScreen()
  2. Dim Shared ScreenBuff as String
  3. ScreenBuff = _
  4. "Hello#F World#O" !"\n" _
  5. "It's it cool how it works?"
  6.  
  7. UpdateScreen
  8. sleep
  9.  
  10. Sub UpdateScreen
  11.     var iStart = 1 'start position
  12.     color 7 'start color?
  13.     do
  14.       var iPosi = instr(iStart,ScreenBuff,"#")
  15.       if iPosi then 'found color change
  16.         print mid$(ScreenBuff,iStart,iPosi-iStart);
  17.         color ScreenBuff[iPosi]-asc("A")
  18.         iStart = iPosi+2 'skip color symbol and number
  19.       else 'no more color change just print rest of the buffer
  20.         print mid$(ScreenBuff,iStart);
  21.         exit do 'and it's done
  22.       end if
  23.     loop    
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement