Author Topic: Console  (Read 1967 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Console
« on: January 26, 2014, 02:10:30 PM »
Deleted
« Last Edit: April 25, 2015, 03:11:15 AM by Peter »

Haim

  • Guest
Re: Console
« Reply #1 on: January 26, 2014, 08:59:11 PM »
Thanks Peter,
the addition of console is a great contribution.

Thanks again.

Charles Pegge

  • Guest
Re: Console
« Reply #2 on: January 27, 2014, 01:51:29 AM »
Thanks Peter,

We have a minimal console in inc/console.inc but yours looks like the full API.

I would however, recommend changing all the long types to sys for 64 bit compatibility.

Here are some helper functions for mundane console use:

Code: [Select]
  Function output(string bufout)
  ==============================
  static sys buflen,bufrit
  buflen=len bufout
  WriteConsole ConsOut,strptr bufout,buflen,bufrit,null
  End Function


  Function input() As string
  ==========================
  static sys blen     
  static zstring bufin[300]     
  ReadConsole ConsIn,strptr bufin,299,blen,null
  return left bufin,blen
  End Function


  Function GetKey() as sys
  ========================
  static sys blen,mode
  static zstring z[4]
  GetConsoleMode ConsIn,mode
  SetConsoleMode ConsIn,0
  ReadConsole ConsIn,strptr z,1,blen,null
  SetConsoleMode ConsIn,mode
  return ?z
  End Function