FUNCTION LOGIT($File,$Data)
If $File='CON'
If $LC=0
shell '%comspec% /c mode CON cols='+$RES[0]+' lines='+2*Int($RES[1]/3)
$=SETCONSOLE("MAXIMIZE")
Endif
If len($Data)>$RES[0]
$LC=$LC+int(len($Data)/$RES[0])+1
Else
$LC=$LC+1
Endif
? $DATA
Else
If open(7,$File,5)=0
$=Writeline(7,$Data+@crlf)
$=Close(7)
Else
$Logit=9
Exit $Logit
Endif
Endif
ENDFUNCTION
Function ScrnRes()
Dim $objWMIService,$colItems,$objItem,$HT,$WI,$COL,$LIN
$objWMIService = GetObject("Winmgmts:\\.\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)
For Each $objItem in $colItems
$WI = $objItem.ScreenWidth
$HT = $objItem.ScreenHeight
Next
;Estimate Max Console Size based on default 8x12 font and 10+10x10+30 frame borders
$RES[0]=int(($WI-20)/8)
$RES[1]=int(($HT-40)/12)
EndFunction