Re: Gotoxy
Posted: 14 Jul 2016 19:20
Cmdwiz stringfind got a "noCase" option.
The executable was re-compiled with gcc.
The executable was re-compiled with gcc.
A Forum all about DOS Batch
https://www.dostips.com/forum/
Code: Select all
@echo off
set H=1000
cmdwiz setbuffersize k %H%
cls
%1 %2 %3 %4 %5 %6 %7 %8 %9
::cmdwiz getcursorpos y
::set H=%errorlevel%
cmdwiz getconsoledim w
set W=%errorlevel%
cmdwiz saveblock output 0 0 %W% %H% txt
set H=&set W=
misol101 wrote:New operation for cmdwiz: printf. This just mimics printf in C, so it's basically an "echo" with printf codes (\n \r \t \a \b \\ are supported). Also, it does not include " if you write printf "text", something I often find annoying with echo. Cons: Slow.
New operation for cmdwiz: setcursorpos. In case gotoxy is not available (the horror!)
Aacini wrote:Does your program mimics printf formats (like "%8i") or is just an echo with control characters?
The way to write control characters via \n, \r, \t, etc, is not part of printf function, but a standard feature of C language that apply in all cases where a string can be written. In other words: \n, \r, \t, etc, are NOT "printf codes"!
Aacini wrote:If the new operation for cmdwiz do the same task than gotoxy.exe command, why you don't name it the same ("gotoxy" operation)?
Code: Select all
@echo off
setlocal ENABLEDELAYEDEXPANSION
cls
cmdwiz savefont oldfont.fnt
cmdwiz setfont Consolas72.cmdfnt
cmdwiz showcursor 1 100
mode 30,8
cmdwiz getwindowbounds w&set PIXELW=!errorlevel!
cmdwiz getwindowbounds h&set PIXELH=!errorlevel!
cmdwiz getdisplaydim w&set SW=!errorlevel!
cmdwiz getdisplaydim h&set SH=!errorlevel!
set /a WPX=%SW%/2-%PIXELW%/2,WPY=%SH%/2-%PIXELH%/2-20
cmdwiz setwindowpos %WPX% %WPY%
set /a YPOS=%PIXELH%/2-20, BMPHEIGHT=1
cmdwiz setcursorpos 9 3
cmdwiz print "CONSOLAS 72"
cmdwiz delay 3000
cmdwiz showcursor 0
for /L %%a in (1,2,%PIXELH%) do cmdwiz insertbmp 123.bmp 0 !YPOS! %PIXELW% !BMPHEIGHT! & set /a YPOS-=2,BMPHEIGHT+=4
set /a MPX = %WPX% + %PIXELW%/2, MPY = %WPY% + 15
cmdwiz setmousecursorpos %MPX% %MPY%
for /L %%a in (0,1,100) do set /a MPX+=2&cmdwiz setmousecursorpos !MPX! %MPY% d
for /L %%a in (0,1,98) do set /a MPX-=2&cmdwiz setmousecursorpos !MPX! %MPY% d
cmdwiz setmousecursorpos !MPX! %MPY% u
cmdwiz setwindowpos 0 0
cmdwiz setfont oldfont.fnt
del /Q oldfont.fnt>nul
mode 80,50 & cmdwiz showcursor 1 & cls
endlocal
Code: Select all
cls & sprite 0 0 goomba.spr & cmdwiz saveblock goomba 0 0 16 17
Code: Select all
gotoxy 0 0 "\N21" & sprite 0 0 goomba.spr & cmdwiz saveblock goomba 0 0 16 17 e 21