@Wonko: thanks for the suggestion. Tested too, no difference.
@steve6375: thanks for the info.
I do not want to criticize anyone, but I found there is still ONE space difference at the end between using %* and %9.
I made a quick script for testing from command-line and in a call.
All tests in Virtual Box - Version 6.1.38 r153438 (Qt5.6.2)
TEXTSTAT.G4B found no spaces at end of any line:
My ultimate target is to read-out all possible STRING's from a call, to use it for my intermediate project Fn11.g4b to test a string for \x00, \x22 AND for the presence of double-quote char.
I imagined a problematic variable for read-out with %1-%8 or %* (and variations with '~').
On first print-screen the variable 'ARG' is set and used - WITHOUT surrounding double-quotes - on the command-line of ARG.g4b I made
BTW: cursor was immediate behind last '%'
As can be seen there is a space behind with %* and not with %9
Also shift was shifting as expected, but no difference regarding 'the extra space'.
And there was a surprise for me too: all spaces between %1-%8 are reduced to one space.
On next print-screen the script continued with the first call of %* (without double-quotes around):
New surprise: one extra space added to %* and %9, %* has now TWO trailing spaces.
Using double-quotes around in call :conv "%*" made no difference regarding reducing %1-%8. The extra space is still there, but each surrounding the last of the two added double-quotes. See next print-screen:
BTW of course %9 is not available, 'space' after '=' is just some artifact using $[0xF0]%9 with empty %9.
(On last line the echo-artifact. I believe there is a new grub4dos 0.4.6a version, I will test).
And so on. However no reduction of %1-%8 if using "%ARG%" in the call:
--------------------------------------
Just for the record: last print-screen shows echo $[0xF0] with various cursor positions - so spaces. On first and last line NO spaces. On second line ONE space:
--------------------------------
Edit: tested with new version of grub4dos (20221026)
[The .calc function supports 64-bit division. Added variable @retval64 to return the 64-bit computed value of the calc function. issues #380
. The [-P:XXYY] function of the echo function allows XX(YY) to be a hexadecimal value. issues #383
. Fixed the $[ABCD] function of the echo function. In the VM (VBOX) console under the BIOS environment, if the first character is used, the screen will be blurred when scrolling. issues #381]*
*Translation by Google Translate
Although issue #381 seems to be solved (did one quick test - first print-screen), no difference for trailing space with %*:
BTW in case of %* no difference between graphics mode/ console mode.
------------------------------------
Script inside the zip with password because of warning for virus or malware. Pass: ARG
ARG.g4b.zip 836bytes
197 downloads
BTW on my Windows 10 computer attachment was downloaded as :'ARG.2v3A7Qk-.g4b(2).zip.part' but after renaming to zip I could open it.
To be sure, if anyone has problems with the zip still the full script:
!BAT
#-#+ ARG.G4B v0.1 (20221102), by deomsh
#-#+ Function: test behavior of '%*', '%~*', '%9', '%~9', '%1, '%~1', %ARG% and "%ARG%" on command-line and in call's
debug 1
echo $[0x00]"$[0x0F]%^*$[] =$[0xF0]%*
echo $[0x00]"$[0x0F]%^~*$[]=$[0xF0]%*
echo $[0x00]"$[0x0F]%^9$[] =$[0xF0]%9
echo $[0x00]"$[0x0F]%^~9$[]=$[0xF0]%~9
echo $[0x00]"$[0x0F]%^1$[] =$[0xF0]%1
echo $[0x00]"$[0x0F]%^~1$[]=$[0xF0]%~1
echo $[0x00]"$[0x00]"$[]shift
shift
echo $[0x00]"$[0x0F]%^*$[] =$[0xF0]%*
echo $[0x00]"$[0x0F]%^~*$[]=$[0xF0]%*
echo $[0x00]"$[0x0F]%^9$[] =$[0xF0]%9
echo $[0x00]"$[0x0F]%^~9$[]=$[0xF0]%~9
echo $[0x00]"$[0x0F]%^1$[] =$[0xF0]%1
echo $[0x00]"$[0x0F]%^~1$[]=$[0xF0]%~1
set "ARG1all=%*"
set "ARG1~all=%~*"
set "ARG1_9=%9"
set "ARG1~9=%~9"
set "ARG1~1=%~1"
set "ARG1_1=%1"
echo $[0x00]"$[0x0F]ARG1all$[] =$[0xF0]%ARG1all%
echo $[0x00]"$[0x0F]ARG1~all$[] =$[0xF0]%ARG1~all%
echo $[0x00]"$[0x0F]ARG1_9$[] =$[0xF0]%ARG1_9%
echo $[0x00]"$[0x0F]ARG1~9$[] =$[0xF0]%ARG1~9%
echo $[0x00]"$[0x0F]ARG1_1$[] =$[0xF0]%ARG1_1%
echo $[0x00]"$[0x0F]ARG1~1$[] =$[0xF0]%ARG1~1%
echo $[0x00]"$[0x0F]call :conv %^*$[0x00]" && pause Key... && clear
call :conv %*
echo $[0x00]"$[0x0F]Returned from :conv using %^* - echo on new line
echo $[0x00]"$[0x0F]call :conv "%^*"$[0x00]" && pause Key... && clear
call :conv "%*"
echo $[0x00]"$[0x0F]Returned from :conv using "%^*" - echo on new line
echo $[0x00]"$[0x0F]call :conv %^9$[0x00]" && pause Key... && clear
call :conv %9
echo $[0x0F]Returned from :conv using %^9 - echo on new line
echo $[0x00]"$[0x0F]call :conv "%^9"$[0x00]" && pause Key... && clear
call :conv "%9"
echo $[0x0F]Returned from :conv using "%^9" - echo on new line
echo $[0x00]"$[0x0F]call :conv %^ARG%$[0x00]" && pause Key... && clear
call :conv %ARG%
echo $[0x00]"$[0x0F]%Returned from :conv using %^ARG% - echo on new line
echo $[0x00]"$[0x0F]call :conv "%^ARG%"$[0x00]" && pause Key... && clear
call :conv "%ARG%"
echo $[0x00]"$[0x0F]Returned from :conv using "%^ARG%" - echo on new line
echo $[0x00]"$[0x0F]call :conv %^*$[0x00]" && pause Key... && clear
call :conv %* && echo $[0x00]"$[0x0F]Returned from :conv using %^* - echo on same line
echo $[0x00]"$[0x0F]call :conv "%^*"$[0x00]" && pause Key... && clear
call :conv "%*" && echo $[0x00]"$[0x0F]Returned from :conv using "%^*" - echo on line
echo $[0x00]"$[0x0F]call :conv %^9$[0x00]" && pause Key... && clear
call :conv %9 && echo $[0x00]"$[0x0F]Returned from :conv using %^9 - echo on same line
echo $[0x00]"$[0x0F]call :conv "%^9"$[0x00]" && pause Key... && clear
call :conv "%9" && echo $[0x00]"$[0x0F]Returned from :conv using "%^9" - echo on same line
echo $[0x00]"$[0x0F]call :conv %^ARG%$[0x00]" && pause Key... && clear
call :conv %ARG% && echo $[0x00]"$[0x0F]Returned from :conv using %^ARG% - echo on same line
echo $[0x00]"$[0x0F]call :conv "%^ARG%"$[0x00]" && pause Key... && clear
call :conv "%ARG%" && echo $[0x00]"$[0x0F]Returned from :conv using "%^ARG%" - echo on same line
pause clear after Key and continue... && clear
echo $[0x00]"$[]shift && shift && shift && shift && shift && shift && shift && shift
shift && shift && shift && shift && shift && shift && shift && shift
echo $[0x00]"$[0x0F]%^*$[] =$[0xF0]%*
echo $[0x00]"$[0x0F]%^~*$[]=$[0xF0]%*
echo $[0x00]"$[0x0F]%^9$[] =$[0xF0]%9
echo $[0x00]"$[0x0F]%^~9$[]=$[0xF0]%~9
echo $[0x00]"$[0x0F]%^1$[] =$[0xF0]%1
echo $[0x00]"$[0x0F]%^~1$[]=$[0xF0]%~1
echo && pause --wait=0 Test without space behind: echo $[0xF0]
echo $[0xF0]
goto :eof
:conv
setlocal
echo $[0x00]"$[0x0F]in %0
echo $[0x00]"$[0x0F]%^*$[] =$[0xF0]%*
echo $[0x00]"$[0x0F]%^~*$[]=$[0xF0]%*
echo $[0x00]"$[0x0F]%^9$[] =$[0xF0]%9
echo $[0x00]"$[0x0F]%^~9$[]=$[0xF0]%~9
echo $[0x00]"$[0x0F]%^1$[] =$[0xF0]%1
echo $[0x00]"$[0x0F]%^~1$[]=$[0xF0]%~1
set ARG1all=%*
set "ARG1xall=%*"
set ARG1_9=%9
set "ARG1_x9=%~9"
set ARG1_1=%1
set "ARG1_x1=%~1"
echo $[0x00]"$[0x0F]ARG1all$[] =$[0xF0]%ARG1all%
echo $[0x00]"$[0x0F]ARG1xall$[]=$[0xF0]%ARG1xall%
echo $[0x00]"$[0x0F]ARG1_9$[] =$[0xF0]%ARG1_9%
echo $[0x00]"$[0x0F]ARG1_x9$[] =$[0xF0]%ARG1_x9%
echo $[0x00]"$[0x0F]ARG1_1$[] =$[0xF0]%ARG1_1%
echo $[0x00]"$[0x0F]ARG1_x1$[] =$[0xF0]%ARG1_x1%
echo shift && shift
echo $[0x00]"$[0x0F]%^*$[] =$[0xF0]%*
echo $[0x00]"$[0x0F]%^~*$[]=$[0xF0]%*
echo $[0x00]"$[0x0F]%^9$[] =$[0xF0]%9
echo $[0x00]"$[0x0F]%^~9$[]=$[0xF0]%~9
echo $[0x00]"$[0x0F]%^1$[] =$[0xF0]%1
echo $[0x00]"$[0x0F]%^~1$[]=$[0xF0]%~1
set ARGSall=%*
set "ARGSxall=%*"
set ARGS_9=%9
set "ARGS_x9=%~9"
set ARGS_1=%1
set "ARGS_x1=%~1"
echo $[0x00]"$[0x0F]ARGSall$[] =$[0xF0]%ARGSall%
echo $[0x00]"$[0x0F]ARGSxall$[]=$[0xF0]%ARGSxall%
echo $[0x00]"$[0x0F]ARGS_9$[] =$[0xF0]%ARGS_9%
echo $[0x00]"$[0x0F]ARGS_x9$[] =$[0xF0]%ARGS_x9%
echo $[0x00]"$[0x0F]ARGS_1$[] =$[0xF0]%ARGS_1%
echo $[0x00]"$[0x0F]ARGS_x1$[] =$[0xF0]%ARGS_x1%
endlocal
goto :eof