<pad> results are different when using or not using a variable

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
altoclef
Posts: 99
Joined: 12 Oct 2012 18:54
Location: Win11 24H2 @100%

<pad> results are different when using or not using a variable

Post by altoclef »

Code: Select all

$string = 'abcd';
    $r1 = "<pad 12>abcd";         //  8 spaces, then the string (12 characters in total)
    $r2 = "<pad 12>$string";      // 12 spaces, then the variable

    text "$r1<crlf>$r2";
(v26.90.0200)

(EDIT: Correct the first comment, which incorrectly referred to "the variable")

admin
Site Admin
Posts: 66538
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: <pad> results are different when using or not using a variable

Post by admin »

Interesting bug! :bug: :tup: Fixed in next beta. :cup:

altoclef
Posts: 99
Joined: 12 Oct 2012 18:54
Location: Win11 24H2 @100%

Re: <pad> results are different when using or not using a variable

Post by altoclef »

Confirm fixed in v26.90.0206. Thank you.

However, this is a breaking change as some existing scripts using <pad> will now work differently from previously. In fact, I wonder whether most of those existing scripts will now break, as use with a variable value must be more common than without. (I know that <pad> is also used in Batch Rename so perhaps script usage is much less common than in that.)

I don't have any affected scripts as I've only just discovered <pad> so I'm OK, thanks :titter:. However, others may be affected. Would it be helpful for the release notes to mention that this is a breaking change?

admin
Site Admin
Posts: 66538
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: <pad> results are different when using or not using a variable

Post by admin »

It's clearly a bug fix. So it's not a breaking change, it's a fixing change. :)

Post Reply