ExtractMultiple.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="ExtractMultiple">
  5. <title>ExtractMultiple</title>
  6. <para><emphasis role="bold">STD.Str.ExtractMultiple<indexterm>
  7. <primary>STD.Str.Extract</primary>
  8. </indexterm><indexterm>
  9. <primary>Str.Extract</primary>
  10. </indexterm><indexterm>
  11. <primary>Extract</primary>
  12. </indexterm>(</emphasis> <emphasis>source, instance</emphasis> <emphasis
  13. role="bold">)</emphasis></para>
  14. <para><emphasis role="bold">STD.Uni.Extract<indexterm>
  15. <primary>STD.Uni.Extract</primary>
  16. </indexterm><indexterm>
  17. <primary>Uni.Extract</primary>
  18. </indexterm>(</emphasis> <emphasis>source, instance</emphasis> <emphasis
  19. role="bold">)</emphasis></para>
  20. <informaltable colsep="1" frame="all" rowsep="1">
  21. <tgroup cols="2">
  22. <colspec colwidth="80.50pt" />
  23. <colspec />
  24. <tbody>
  25. <row>
  26. <entry><emphasis>source</emphasis></entry>
  27. <entry>A string containing a comma-delimited list of data.</entry>
  28. </row>
  29. <row>
  30. <entry><emphasis>instance </emphasis></entry>
  31. <entry>An integer specifying the ordinal position of the data item
  32. within the <emphasis>source</emphasis> to return.</entry>
  33. </row>
  34. <row>
  35. <entry>Return:<emphasis> </emphasis></entry>
  36. <entry>Extract returns either a STRING or UNICODE value, as
  37. appropriate.</entry>
  38. </row>
  39. </tbody>
  40. </tgroup>
  41. </informaltable>
  42. <para>The <emphasis role="bold">Extract </emphasis>function returns the data
  43. at the ordinal position specified by the <emphasis>instance
  44. </emphasis>within the comma-delimited <emphasis>source</emphasis>
  45. string.</para>
  46. <para>Example:</para>
  47. <programlisting format="linespecific">//all these examples result in 'Success'
  48. A := IF(STD.Str.Extract('AB,CD,,G,E',0) = '',
  49. 'Success',
  50. 'Failure -1');
  51. B := IF(STD.Str.Extract('AB,CD,,G,E',1) = 'AB',
  52. 'Success',
  53. 'Failure -2');
  54. C := IF(STD.Str.Extract('AB,CD,,G,E',2) = 'CD',
  55. 'Success',
  56. 'Failure -3');
  57. D := IF(STD.Str.Extract('AB,CD,,G,E',3) = '',
  58. 'Success',
  59. 'Failure -4');
  60. E := IF(STD.Str.Extract('AB,CD,,G,E',4) = 'G',
  61. 'Success',
  62. 'Failure -5');
  63. F := IF(STD.Str.Extract('AB,CD,,G,E',5) = 'E',
  64. 'Success',
  65. 'Failure -6');
  66. G := IF(STD.Str.Extract('AB,CD,,G,E',6) = '',
  67. 'Success',
  68. 'Failure -7');
  69. </programlisting>
  70. </sect1>