Wildcard * is missing when concatenated with a variable

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

: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: Use Your Profile Or Signature
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: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
altoclef
Posts: 99
Joined: 12 Oct 2012 18:54
Location: Win11 24H2 @100%

Wildcard * is missing when concatenated with a variable

Post by altoclef »

Code: Select all

$v = 'foobar';

    // Most characters can be concatenated with the variable, e.g.:
    $withHashAtBeginning = "#$v";
    msg "Hash at beginning: $withHashAtBeginning";

    $withFullStopAtBeginning = ".$v";
    msg "Full stop at beginning: $withFullStopAtBeginning";

    $withQuestionMarkAtBeginning = "?$v";
    msg "Question mark at beginning: $withQuestionMarkAtBeginning";
    
    // However, there seems to be an issue with the * wildcard character but only at the beginning:
    $withWildcardAtBeginning = "*$v";
    $withWildcardAtEnd = "$v*";

    msg "Wildcard at end: $withWildcardAtEnd";
    msg "Wildcard missing at beginning: $withWildcardAtBeginning", 48;

    // There is a workaround:
    $withWildcardAtBeginning = '*' . $v;  
    msg "Wildcard at beginning using workaround: $withWildcardAtBeginning";
Have I misunderstood something? It seems like a bug to me.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Wildcard * is missing when concatenated with a variable

Post by highend »

Dereferencing, consult the help file…
One of my scripts helped you out? Please donate via Paypal

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

Re: Wildcard * is missing when concatenated with a variable

Post by altoclef »

Thank you. I wasn't aware of the dereferencing operator. Please can you move this thread out of Bug Reports.

I mostly understand the concept. However, this is confusing me:

Code: Select all

$v = 'vampire'; $vd = '$v';

   aid 0;             // dereferencing not allowed
   text      " *$vd"; //  *$v       (as expected: asterisk character and contents of $vd)
   text ' ' . "*$vd"; //  vampire   (why is the asterisk being taken as a dereferencing operator?)

Could you explain the difference, please?

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

Re: Wildcard * is missing when concatenated with a variable

Post by admin »

I'd say that's a bug. :bug: :tup: Fixed in next beta.

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

Re: Wildcard * is missing when concatenated with a variable

Post by altoclef »

Confirmed fixed in v.26.90.0106. Thanks. :tup:

Post Reply