Quantcast
Channel: GSAK Forum
Viewing all articles
Browse latest Browse all 75087

Issue with "extract" by The CEO - 2013-12-24

$
0
0
I observe an issue with the macro command extract.
The following codes shows the issue:

GSK
$Data = "Apple;Pear;Orange"
$Fruit = Extract($Data, ";", 3)
MsgOk msg=$Data / $Fruit

$Data = "Apple---Pear---Orange"
$Fruit = Extract($Data, "---", 3)
MsgOk msg=$Data / $Fruit

$Data = "Apple;Pear;Oranges"
$Fruit = Extract($Data, ";", 3)
MsgOk msg=$Data / $Fruit

$Data = "ApplesssPearsssOranges"
$Fruit = Extract($Data, "sss", 3)
MsgOk msg=$Data / $Fruit

$Data = "Apple---Pear---Orange-"
$Fruit = Extract($Data, "---", 3)
MsgOk msg=$Data / $Fruit


In the 1st and 2nd case, the output is as expected: Orange
In the 3rd case, the output is also as expected: Oranges (note the additional s).
In the 4th case however, the output is Orange (without the additional s). To me, that is unexpected and wrong.
I would have expected this output if there would be "sss" at the end, but not when there is only a single "s".

The problem is not dependant on using letters, as is show by the 5th case.
Here I would expect "Orange-" to be the result, but instead "Orange" is reported.


Viewing all articles
Browse latest Browse all 75087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>