Page 39 of 41
Re: Scripting Bugs
Posted: 21 Mar 2017 08:49
by admin
Thanks, fixed in next version.
Re: Scripting Bugs
Posted: 22 Mar 2017 12:40
by TheQwerty
Custom columns do not seem to like functions (or multiple 'returns'):
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
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'.
Re: Scripting Bugs
Posted: 22 Mar 2017 13:10
by admin
You got it, functions are not supported here. Too slow.
Hmm, apparently not totally true. Needs further investigation...
Re: Scripting Bugs
Posted: 22 Mar 2017 13:15
by TheQwerty
Combination of functions and concatenation perhaps?
Re: Scripting Bugs
Posted: 22 Mar 2017 14:27
by admin
No, I just finished the thinking: User functions are not supported in the column scripts. Will update Help file.
Re: Scripting Bugs
Posted: 22 Mar 2017 14:36
by TheQwerty
admin wrote:No, I just finished the thinking: User functions are not supported in the column scripts. Will update Help file.
But they can still be used if the CC loads a script file, right?
Re: Scripting Bugs
Posted: 22 Mar 2017 14:37
by admin
Yep. Just not right in the top script.
Re: Scripting Bugs
Posted: 22 Mar 2017 14:41
by TheQwerty
Not looking forward to the confusion this will cause but I'm okay with the limitation.
Re: Scripting Bugs
Posted: 22 Mar 2017 15:20
by admin
Sigh, you are right, of course. Okay okay...
Re: Scripting Bugs
Posted: 22 Mar 2017 15:29
by TheQwerty
admin wrote:Sigh, you are right, of course. Okay okay...
No, it's really okay - that was not an attempt to guilt you into making it work.
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
Posted: 22 Mar 2017 15:40
by admin
Already done.

Re: Scripting Bugs
Posted: 28 Mar 2017 13:47
by autocart
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
Posted: 28 Mar 2017 14:33
by LittleBiG
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
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...)
Re: Scripting Bugs
Posted: 28 Mar 2017 14:47
by autocart
LittleBiG wrote:It is in sync with the help file ...
Thx, LB,
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.
Re: Scripting Bugs
Posted: 27 Jun 2017 23:26
by Filehero
Should the message really pop up?
Code: Select all
// v <-- note the SECOND closing bracket here
if (1 == 2)) {
msg("Wouw, Math revolution!");
}