Scripting Bugs
Re: Scripting Bugs
Custom columns do not seem to like functions (or multiple 'returns'):Column shows:If you swap the lines defining C() and B() (so they are in a logical order) the column shows 'AB'.
In both cases it should be showing 'ABCD'.
Code: Select all
Snip: CustomColumn 1
XYplorer 17.70.0208, 3/22/2017 7:36:18 AM
Action
ConfigureColumn
Caption
Test
Type
3
Definition
function A() { return 'A'; }
function C() { return B() . 'C'; }
function B() { return A() . 'B'; }
return C() . 'D';
Format
0
Trigger
0
Item Type
2
Item Filter
Code: Select all
B() . 'C'
In both cases it should be showing 'ABCD'.
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting Bugs
Hmm, apparently not totally true. Needs further investigation...
FAQ | XY News RSS | XY Twitter
Re: Scripting Bugs
Combination of functions and concatenation perhaps?
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting Bugs
No, I just finished the thinking: User functions are not supported in the column scripts. Will update Help file.
FAQ | XY News RSS | XY Twitter
Re: Scripting Bugs
But they can still be used if the CC loads a script file, right?admin wrote:No, I just finished the thinking: User functions are not supported in the column scripts. Will update Help file.
Re: Scripting Bugs
Not looking forward to the confusion this will cause but I'm okay with the limitation.
Re: Scripting Bugs
No, it's really okay - that was not an attempt to guilt you into making it work.admin wrote:Sigh, you are right, of course. Okay okay...
If that's a limitation of CCS and it is documented then it is perfectly okay in my mind to have this limitation.
There are already differences in how the CCS dialog takes scripts vs other places in XY.
A Run Script UDC is a single line - the Edit button for multi-line creates a multi-script resource and thus requires paying the normal amount of care to whitespace.
CCS starts with a multi-line field and graces the user with some leniency over the whitespace handling. If this comes at the cost of user functions that is fine. In fact, it's almost good in that it discourages a user from using them here where execution complexity impacts navigation speed most. Further functions are still allowed in a loaded script file so nothing is truly lost.
Documenting the limitation is all this is needed.
Re: Scripting Bugs
XYplorer 17.80.0006 (Win 8.1 x64)
INTEGER DIVISION = is being rounded half away from zero (wird kaufmännisch gerundet)
I don't think that the help file says that nor that it is intended, right?
To confirm, try:
::echo 5.49 \ 2; //returns 2
::echo 5.50 \ 2; //returns 3
also:
::echo 5.5 \ 2.49;
::echo 6 \ 2.49; //return 3
and
::echo 5.5 \ 2.5;
::echo 6 \ 2.5; //return 2
INTEGER DIVISION = is being rounded half away from zero (wird kaufmännisch gerundet)
I don't think that the help file says that nor that it is intended, right?
To confirm, try:
::echo 5.49 \ 2; //returns 2
::echo 5.50 \ 2; //returns 3
also:
::echo 5.5 \ 2.49;
::echo 6 \ 2.49; //return 3
and
::echo 5.5 \ 2.5;
::echo 6 \ 2.5; //return 2
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
Re: Scripting Bugs
It is in sync with the help file because it says that in case of integer division, the operands are rounded before the operation. Then the fraction part will be stripped. So everything you brought as example are expected. (However, personally this integer division seems pretty meaningless to me...)autocart wrote:XYplorer 17.80.0006 (Win 8.1 x64)
INTEGER DIVISION = is being rounded half away from zero (wird kaufmännisch gerundet)
I don't think that the help file says that nor that it is intended, right?
To confirm, try:
::echo 5.49 \ 2; //returns 2
::echo 5.50 \ 2; //returns 3
also:
::echo 5.5 \ 2.49;
::echo 6 \ 2.49; //return 3
and
::echo 5.5 \ 2.5;
::echo 6 \ 2.5; //return 2
Re: Scripting Bugs
Thx, LB,LittleBiG wrote:It is in sync with the help file ...
I should have finished that sentence in the help file and studied all the examples more carefully.
The sentence in the help file reads:
"With integer division (the portion of the result after the decimal point is lost) and modulo (the remainder of integer division) the operands are rounded before the operation!"
I stopped reading at the word "modulo". sorry.
Plus, a search in the forum brought up this post:
viewtopic.php?f=7&t=13822&p=124978&hili ... on#p124978
which mislead me even more. Thx for the correction. Sorry again.
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
Re: Scripting Bugs
Should the message really pop up?
Code: Select all
// v <-- note the SECOND closing bracket here
if (1 == 2)) {
msg("Wouw, Math revolution!");
}