quotes in function-variables (<get >, <prop >)
Forum rules
You might want to read this if you're looking for priority service
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%).
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.
How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
You might want to read this if you're looking for priority service
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%).
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.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
quotes in function-variables (<get >, <prop >)
get() -> genericfiletype doesn't work as expected if filetype is provided in single-quotes '{:Media}' . Is it bad, doc?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Scripting Bugs
okay, it's when the functions are converted to variables.
And it's not only genericfiletype, nor only <get >
Not all get info types don't seem to be affected.
Code: Select all
echo get('genericfiletype', '{:Image}'); //all combinations of quotes work when functionized.
echo <get genericfiletype "{:Image}">;
echo <get genericfiletype '{:Image}'>;
echo <get 'genericfiletype' '{:Image}'>;
echo <get "genericfiletype" "{:Image}">;Code: Select all
::text <prop System.Volume.IsRoot>;
text <prop "System.Volume.IsRoot">;Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Bugs
Not a bug, but not a feature. 
I never claimed anywhere that single quotes work here. Nor that <prop> supports internal quotes.
I never claimed anywhere that single quotes work here. Nor that <prop> supports internal quotes.
FAQ | XY News RSS | XY X
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Scripting Bugs
eh? that seems pretty counter-intuitive: a string that can't be quoted?
Besides, it's only logical that get() and <get> have the same looks (well, almost, if you discount the absence of commas and braces)
PeterH will go mad!
Besides, it's only logical that get() and <get> have the same looks (well, almost, if you discount the absence of commas and braces)
PeterH will go mad!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Scripting Bugs
You mean this?SammaySarkar wrote:PeterH will go mad!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Scripting Bugs
I'd consider all of these to be bad form because they result in confusing string usage:Now if you want to replace '{:Image}' or 'System.Volume.IsRoot' with a variable what are you going to do?
(Frankly, this is why I also avoid these variables as much as possible.)
Code: Select all
echo <get genericfiletype "{:Image}">;
echo <get genericfiletype '{:Image}'>;
echo <get 'genericfiletype' '{:Image}'>;
echo <get "genericfiletype" "{:Image}">;
text <prop "System.Volume.IsRoot">;(Frankly, this is why I also avoid these variables as much as possible.)
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Scripting Bugs
I'll remove the quotes when replacing them with variables.
But they have every right to be quoted as long as they're plain strings!
it's just syntax.
But they have every right to be quoted as long as they're plain strings!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Scripting Bugs
That was a bit of a misnomer - you can't just remove the quotes, XY does not perform double interpolation.SammaySarkar wrote:I'll remove the quotes when replacing them with variables.
But they have every right to be quoted as long as they're plain strings!it's just syntax.
I view this as no different from:
Code: Select all
echo how "are" you?;-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Bugs
it might be necessary though as in this example:
Code: Select all
> In the change log of v14.80.0239 - 2015-03-05 15:04 I claimed "both work
the same":
<get counticons "<cc_item>">
<get counticons <cc_item>>
Wrong! The second example will fail for filenames with spaces in them!
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Scripting Bugs
SammaySarkar wrote:eh? that seems pretty counter-intuitive: a string that can't be quoted?
Besides, it's only logical that get() and <get> have the same looks (well, almost, if you discount the absence of commas and braces)
PeterH will go mad!
Completely correct!
(Though it's too late now.
Had a lot of laugh reading this communication!
And, though all seem to know it now: a string is a string and should be specified as - you guess what? - a string
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Bugs
I share TheQwerty's mixed feelings about this. All these work now, and some of them do look a bit funny:
Code: Select all
echo <get "genericfiletype" '{:Image}'>;
echo "<get "genericfiletype" '{:Image}'>"; //hmm...
echo "<get ""genericfiletype"" '{:Image}'>"; //hmm...
echo eval("<get " . "genericfiletype" '{:Image}'>);
$g = genericfiletype; echo eval(<get "$g" '{:Image}'>);FAQ | XY News RSS | XY X
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Scripting Bugs
Code: Select all
echo "<get "genericfiletype" '{:Image}'>"; //hmm...Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
XYplorer Beta Club