GlobalAccessSoftware icon

add_padding.bat

GlobalAccessSoftware | PRO | 11/16/23 05:17:32 AM UTC | 0 ⭐ | 13542 👁️ | Never ⏰ | []
Batch |

1.51 KB

|

Software

|

0 👍

/

0 👎

 
 
::: RC4
 
:::::::::::::::::::::::::::::::::::::::::::
::: add_padding.bat  private extension  :::
:::::::::::::::::::::::::::::::::::::::::::
::: CALCULATES and Pads %str% to equal  :::
::: the correct string length needed.   :::
::: Simply by adding %addspcs% spaces.  :::
:::::::::::::::::::::::::::::::::::::::::::
::: split out from runtime_display.bat  :::
::: v7.9.8.89 20221124005533  by -JpE-  :::
:::::::::::::::::::::::::::::::::::::::::::
 
  if not defined vers set vers=v8.7.0.10 20231108073214 by -JpE-
  ::: NOTE: This is merely a specific Function
  ::: extension for use by runtime_display.bat (only)
  
::::::::::::::::::::::::::
call %strlen% leng1,l1
call %strlen% leng2,line
::::::::::::::::::::::::::
 
:::::: NOW Calc Desired Length :::::::::
set /a desired=(%leng1%-6)
set /a addspcs=(%desired%-%leng2%)
::: And make it ^^^^^^^^^^^^^^^^^ longer.
if %addspcs% lss 0 goto return
::::::: Unless already too ^ long ::::::
 
set newstr=%line%
set /a nnn=(%addspcs%)
set /a num=0
set spc= 
::: use ^ whatever char desired here. ::
 
:padit
set /a num+=1
if %num% gtr %nnn% goto checkit
set newstr=%newstr%%spc%
goto padit
 
:checkit
::::::::::::::::::::::::::
call %strlen% len,newstr
::::::::::::::::::::::::::
set /a ok=0
set /a chk=(%leng2%+%addspcs%)
if %desired% equ %chk% set /a ok+=1
if %len% equ %chk% set /a ok+=2
if %len% equ %desired% set /a ok+=4
if %ok% lss 3 echo unverified, Using as was...
 
if %ok% gtr 4 set line=%newstr%
 
:return
 
 
 
:::  100%  -JpE-
 
 
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎