  % filename "t.exe"
  'uses RTL32
  '% NoConsole
  '% TryAttachConsole
  uses Console
  uses SysUtil

  Color 0xf8
  cls


  function Console(string ti)
  ===========================
  SetConsoleTitle ti
  zstring dt[0x100]
  string s
  int le 
  'GetCurrentDirectory 0xff, strptr dt
  'output GetCommandline() cr cr
  do
    Color 0xf2
    output(dt+chr(2,32))
    Color 0xf0
    s=ltrim rtrim input
    if s
      s=lcase s
      le=len s
      'COMMAND INTERCEPTS
      if s="exit" then exit do
      'if s="?"
      '  output "gxo2 <file>" cr
      '  continue do
      'end if
      if left (s,3)="cd "
        s=ltrim mid s,4
        SetCurrentDirectory s
        continue do
      end if 
      Color 0xf3
      DOS s,1
    end if
  end do
  end function

  Console "OxygenBasic Command Prompt"
  FreeConsole

