$ filename "s119.exe"
'uses rtl32
'uses rtl64
#console
% TryAttachConsole
uses console
def instat inkey
type CONSOLE_CURSOR_INFO
dword dwSize
bool bVisible
end type
! SetConsoleCursorInfo lib "kernel32.dll" (sys hConsoleOutput, CONSOLE_CURSOR_INFO *lpConsoleCursorInfo) as bool
sub locate (int row,int col,optional int showCursor=1,int shape=12)
CONSOLE_CURSOR_INFO cci
SetPos(col-1,row-1)
cci.bVisible = showCursor
cci.dwSize = shape
SetConsoleCursorInfo(ConsOut, cci)
end sub
sub color(int fg, bg)
SetConsoleTextAttribute (ConsOut, fg+bg*16)
end sub
#lookahead
=============================================================================
cls
DrawBox (20,5,60,20,14,4,11,9,3,"Oxygenbasic >< ROCKS!")
While Not Instat
Locate 12,29,0
Color 4,9
Print "Oxygenbasic >< ROCKS!"
Sleep(200)
Locate 12,29,0
Color 15,9
Print "Oxygenbasic >< ROCKS!"
Sleep(200)
Wend
Color 7,0
SUB DrawBox (int X1,Y1,X2,Y2,Bdrfg,Bdrbg,Winfg,Winbg,Style,string Title$)
dim Tb,Sid,Tlc,Trc,Blc,Brc,Tmp
dim Temp$ as string
Select Case Style
'-----------------------------------------------------------------
Case 1 : 'Single Sides,Top And Bottom
'-----------------------------------------------------------------
Tb=196 : Sid=179 : Tlc=218 : Trc=191 : Blc=192 : Brc=217
'-----------------------------------------------------------------
Case 2 : 'Double Sides,Top And Bottom
'-----------------------------------------------------------------
Tb=205 : Sid=186 : Tlc=201 : Trc=187 : Blc=200 : Brc=188
'-----------------------------------------------------------------
Case 3 : 'Single Sides,Double Top And Bottom"
'-----------------------------------------------------------------
Tb=205 : Sid=179 : Tlc=213 : Trc=184 : Blc=212 : Brc=190
'-----------------------------------------------------------------
End Select
Temp$ = Chr$(Tlc) & String$(X2-X1-2,chr(Tb)) & Chr$(Trc)
Locate Y1,X1,0 : Color(Bdrfg,Bdrbg) : Print Temp$
Locate Y1,((X1+X2)/2) - (Len(Title$)/2),0 : Print Title$
For Tmp = Y1+1 To Y2-1
Color Bdrfg,Bdrbg
Locate Tmp,X1,0 : Print Chr$(Sid)
Color Winfg,Winbg : Print Space$(X2-X1-2)
Color Bdrfg,Bdrbg : Print Chr$(Sid)
Next
Temp$ = Chr$(Blc) & String$(X2-X1-2,chr(Tb)) & Chr$(Brc)
Locate Y2,X1,0 : Print Temp$
End Sub
===============================================================
locate 24,1
color 7,0
print "Enter a key..."
waitkey