I don't know if this might help - it's one of Fletchie's bits of magic from long ago ..  :)

______________________________________________________________________

gosub InitConsoleMisc

def x,y:int
def rtn:string

openconsole  

print "This line and the line below will be repeated"
print "This line and the line above will be repeated"
print
for y=1 to 2
for x=1 to 80
print GetConsoleChr(y,x),
next x
next y
def f,b:int
locate 6,8
color 15,10
print "Color 15,10 - Test"
GetConsoleAtt(6,8,f,b)

print "Foreground=",f
print "Background=",b
input rtn

closeconsole  

end

sub InitConsoleMisc

declare "kernel32",GetStdHandle(Hnd:uint),int
declare "kernel32",GetConsoleScreenBufferInfo(hnd:int,bufinfo:memory),int
declare "kernel32",ReadConsoleOutputCharacterA(hnd:int,a$:string,le:int,c:int,co:pointer),int
declare "kernel32",ReadConsoleOutputAttribute(hnd:int,a$:string,le:int,c:int,co:pointer),int
declare GetCurPos(y:pointer,x:pointer)
declare GetConsoleChr(y:int,x:int)
declare GetConsoleAtt(y:int,x:int,f:pointer,b:pointer)
type info
def x:word
def y:word
def xc:word
def yc:word
def at:word
def le:char
def top:char
def ri:char
def bot:char
def xm:word
def ym:word
endtype

setid "std_output_handle",0xfffffff5

return

sub GetCurPos(y,x)

def in:info
def mem:memory
def n:int

      allocmem(mem,1,len(in))

      n=GetStdHandle(@std_output_handle)
      GetConsoleScreenBufferInfo(n,mem)
      readmem mem,1,in
      'returns zero based but locate is one based so add 1
      #x=in.xc+1
      #y=in.yc+1
      freemem mem

return

sub GetConsoleChr(y,x)

def r$:string
def nr,n:int

      n=GetStdHandle(@std_output_handle)
      ReadConsoleOutputCharacterA(n,r$,1,(y-1)*65536+x-1,nr)

return r$

sub GetConsoleAtt(y,x,f,b)

def r$:string
def nr,n:int

      n=GetStdHandle(@std_output_handle)
      ReadConsoleOutputAttribute(n,r$,1,(y-1)*65536+x-1,nr)

      if r$=""
            #f=0
            #b=0
      else
            'foreground in low nibble
            'background in high nibble
            #f=asc(r$)&15
            #b=asc(r$)/16
      endif

return

_______________________________________________________________________________

all the best, :)

Graham