Page 9 of 28

Re: Website and Help Typos

Posted: 22 Oct 2015 16:27
by klownboy
:tup: If it has spaces around the " | ", I suppose if it has spaces around item(s) except for the first and last item.

Re: Website and Help Typos

Posted: 22 Oct 2015 16:49
by admin
Yes. That's why I used "respectively." I'm still surprised that this does not work in English. But hey, you learn every day.

Re: Website and Help Typos

Posted: 22 Oct 2015 17:39
by Gandolf
It's grammatically incorrect because you haven't mentioned the items already, it has to refer back to items already mentioned.

Oxford Dictionary of English.
respectively:
separately or individually and in the order already mentioned (used when enumerating two or more items or facts that refer back to a previous statement). e.g. they received sentences of one year and eight months respectively.

Yes, I'm still here!!

Re: Website and Help Typos

Posted: 22 Oct 2015 17:47
by highend
I have to praise god every day just because German is such an easy language^^

Re: Website and Help Typos

Posted: 22 Oct 2015 17:57
by klownboy
Apples and oranges are both fruit, their color typically red and orange respectively.

Re: Website and Help Typos

Posted: 22 Oct 2015 18:04
by admin
Gandolf wrote:It's grammatically incorrect because you haven't mentioned the items already, it has to refer back to items already mentioned.

Oxford Dictionary of English.
respectively:
separately or individually and in the order already mentioned (used when enumerating two or more items or facts that refer back to a previous statement). e.g. they received sentences of one year and eight months respectively.

Yes, I'm still here!!
Wow, so grammar is the bait to lure you out of your cave! (Gasp, I hope this was close to English.)

Thanks for the explanation. Looks like I used "respectively" wrong all my live. I will try to avoid the word in future. :)

Re: Website and Help Typos

Posted: 22 Oct 2015 18:27
by Gandolf
My two brothers were both English teachers, a Headmaster and head of department respectively. I didn't get a chance to use incorrect English!

Back to the cave.

Re: Website and Help Typos

Posted: 15 Nov 2015 17:37
by highend
Advanced Topics - Scripting Commands Reference - tab()

"get"...

data:

[empty or missing] the index of the current tab (first tab = 1).

This one looks weird in the .chm file. Screenshot attached. Regardless of how wide I make the help file

More important (still for "get"):

index: unused

This isn't unused?

Code: Select all

text tab("get", "data", 3);
Returns the unresolved path for the 3rd index

Re: Website and Help Typos

Posted: 15 Nov 2015 17:50
by admin
Some minutes too late, but thanks. :)

Re: Website and Help Typos

Posted: 20 Feb 2016 13:36
by PeterH
Formatting error in help:

gettokenindex(), flag c: :arrow: misses an empty line to separate, and must be tabbed 1 pos to the right. (Like i: and w: are.)
(As it is now, I just missed it :whistle: )

Edit: the rest WAS misinterpretation :!:
Oh - and [flags=iw] is missing the c, too.

:shock: (from interpreting the examples!)
I don't think the combination of flags is OK as defined here! If I understand it right:
"w" interprets wildcards defined in token (i.e. if token = "value*")
"" uses token exact as is (in token = "value*" the * is not a wildcard?)
missing flags-operand interprets token as *token* (use "generic" wildcards)
:arrow: but how to differentiate the last 2 versions, if flags = "i" :?:

Or do I misinterprete the examples?

Re: Website and Help Typos

Posted: 20 Feb 2016 14:16
by klownboy
Hi PeterH, I thought I had the rules for this one down, but maybe not. What do you mean by?
PeterH wrote:missing flags-operand interprets token as *token* (use "generic" wildcards)
- If the "w" flag is included and yet the scripter does not include any wildcard in his token, it will be interpreted as a generic *token* wildcard each side.
- If the "w" flag is included and the token has a wildcard, the token (with wildcard) is used as written.
- If the "w" is not included the token is treated literally no wildcards.
- If the "i' flag is used, it's treated totally independent of the above.

Re: Website and Help Typos

Posted: 20 Feb 2016 14:45
by PeterH
There are 2 examples in Help:

Code: Select all

  echo gettokenindex("red", "Blue;12|Red;15|Green;28"); //2 (*red*)
  echo gettokenindex("red", "Blue;12|Red;15|Green;28", , ""); //0 (red)
1) token "red" seems to be used generic as "*red*" - so entry "Red;15" is found
2) token "red" is used exact as is - so no return found

Re: Website and Help Typos

Posted: 20 Feb 2016 15:10
by klownboy
OK, I see what you mean in those 2 examples.

- In example 1, Don should not have used the * on each end of the token red (*red*). Since in this example, the "w" flag was not used, the interpretation should be (red) and it's not case sensitive (the default even though the "i" is not specified). The generic *token* is only used when the "w" flag is used, but no wildcard is specified. The answer is correct as 2 though.

- In example 2, I assume the default is "i" (case insensitive) even though the help doesn't say it. So you shouldn't have to have an the ''i" specified as a flag if that's what you want. If you quote nothing, it's taken to mean case sensitive which seems a bit different from the typical ways to specify case sensitivity. Again the answer for this example, if the above is true, is correct.

Re: Website and Help Typos

Posted: 20 Feb 2016 15:16
by bdeshi

Code: Select all

echo gettokenindex("red", "Blue;12|Red;15|Green;28"); //2 (*red*)
PeterH wrote:1) token "red" seems to be used generic as "*red*" - so entry "Red;15" is found
klownboy wrote:In example 1, Don should not have used the * on each end of the token red (*red*). Since in this example, the "w" flag was not used
the default value of the flag parameter is given as "iw", therefore the return is indeed correct.
gettokenindex ref wrote:gettokenindex(token, tokenlist, [separator=|], [flags=iw]);

Re: Website and Help Typos

Posted: 20 Feb 2016 15:28
by bdeshi
> peterH: Oh - and [flags=iw] is missing the c, too.
- Because "c" isn't in part of the default value.

> "w" interprets wildcards defined in token (i.e. if token = "value*")
- Yes.

Code: Select all

 echo gettokenindex("Red*", "Blue;12|*Red*|Red;15|Red*|Green;28",,'w'); //3 ( Red* == Red;15 != *Red* )
> "" uses token exact as is (in token = "value*" the * is not a wildcard?)
- No the * isn't a wilcard in this case.

Code: Select all

 echo gettokenindex("red*", "Blue;12|Red;15|Red*|red*|Green;28",,''); //4 ( 'red*' != 'Red*' )
 echo gettokenindex("red*", "Blue;12|Red;15|red*|Green;28",,'i'); //3 ( 'red*' == 'Red*' )
> missing flags-operand interprets token as *token* (use "generic" wildcards)
- Yes, because of "iw" default value.

> :arrow: but how to differentiate the last 2 versions, if flags = "i" :?:

Code: Select all

echo gettokenindex("*Red*", "Blue;12|__Red;15__|*Red*|Green;28",,'iw'); //2 ( *red* == *Red* )
echo gettokenindex("*Red*", "Blue;12|__Red;15__|*Red*|Green;28",,'i'); //3 ( '*red*' )
so, been away from XYplorer for a while? :wink:

[edited] - examples, formatting