GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | BCS

Edit History

BCS

r = BCS (s)

Home > Reference > String

Converts the BASIC-style string s to C-style string by masking escape codes. Escape codes in the string will not be applied to format the string when printed on the screen. Instead escape codes will be printed as they are.

See CBS to unmasked a c-style string, and see article “Escape codes” for more information about escape codes.

Example

' define some escape codes
const NORMAL             = "\e[0m"  ' = Cat(0)
const BOLD               = "\e[1m"  ' = Cat(1)
const BOLD_OFF           = "\e[21m" ' = Cat(-1)
const BG_CYAN            = "\e[46m"
const TB                 = "\t"

' Create a string with escape codes
BasicStyleString               = BOLD + "BOLD" + BOLD_OFF + TB + TB + BG_CYAN + "COLORFULL BG" + NORMAL
CStyleString                   = bcs(BasicStyleString)
BackConverted_BasicStyleString = cbs(CStyleString)

print "Basic-style string            : "; BasicStyleString
print "C-style string                : "; CStyleString
print "Back conversion to basic style: "; BackConverted_BasicStyleString

' Output will be (with colors and in bold)
' Basic-style string            : BOLD      COLORFULL BG
' C-style string                : \e[1mBOLD\e[21m\t\t\e[46mCOLORFULL BG\e[0m
' Back conversion to basic style: BOLD      COLORFULL BG
Code samples using BCS
Another center finder.bas   circumscribe triangle.bas   middle finder.bas   origin finder.bas  
String
ASC   BCS   BIN   CBS   CHOP   CHR   DISCLOSE   ENCLOSE   FORMAT   HEX   INSTR   JOIN   LCASE   LEFT   LEFTOF   LEFTOFLAST   LOWER   LTRIM   MID   OCT   REPLACE   RIGHT   RIGHTOF   RIGHTOFLAST   RINSTR   RTRIM   SINPUT   SPACE   SPC   SPLIT   SPRINT   SQUEEZE   STR   STRING   TRANSLATE   TRIM   UCASE   UPPER   VAL  
This page was last edited on Tue, 19 Sep 2023 14:31:12 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.