Difference: 0LASubrTextFindAndReplace (1 vs. 4)

Revision 42023-04-10 - BrianRyan

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT FIND AND REPLACE

Line: 51 to 51
  <len_of_replace> is the number of characters from <start_of_replace> to be used (Optional). If you PASS a zero or blank, <search_text> will be 'cut' from <text_field>. If not PASSed at all, <replace_with> will be used to the end of the field.
Changed:
<
<
Note this is a case sensitive search, regular expressions are not allowed.
>
>
Notes:
  • This is a case sensitive search, regular expressions are not allowed.
  • This subroutine is designed to operate on Alpha, Text, and Token fields only. The returned results are undefined if you specify any other type of field.
 

Comments:

Read what other users have said about this page or add your own comments.

Revision 32012-03-27 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT FIND AND REPLACE

Line: 31 to 31
  <search_text> is the text to be searched for (Required).
Changed:
<
<
<replace_with> is the replacement text (Optional). If not PASSed or blank, this routine will 'cut' the the <search_text> from <text_field>.
>
>
<replace_with> is the replacement text (Optional). If not PASSed this routine will 'cut' the the <search_text> from <text_field>. This is different from PASSing a blank field, if you pass a blank field, then blanks will be inserted into <text_field>. The number of blanks will depend on the <len_of_replace> field below.
  <no_of_replacements> returns the number of times the text was replaced (Optional). This must be PASSed with Share "Y" to return the value.

<skip> is the number of occurrences of <search_text> to skip before beginning replacement (Optional). If not PASSed, all occurrences will be replaced.

Changed:
<
<
<max_no_replace> is the maximum number of replacements you want performed (Optional). If not provided, all occurrences will be replaced. For example, if you only want the first 2 occurrences replaced, PASS 0 for <skip> and 2 for <max_no_replace>, or if you only want the 3rd & 4th occurrences replaced, PASS 2 for <skip> and 2 for <max_no_replace>. You can also PASS -1 to indicate all occurrences.
>
>
<max_no_replace> is the maximum number of replacements you want performed (Optional). If not PASSed or a blank/zero value is PASSed, all occurrences will be replaced. For example, if you only want the first 2 occurrences replaced, PASS 0 for <skip> and 2 for <max_no_replace>, or if you only want the 3rd & 4th occurrences replaced, PASS 2 for <skip> and 2 for <max_no_replace>. You can also PASS -1 to indicate all occurrences.
 
Changed:
<
<
<start_of_text> is the starting position in <text_field> to begin the search (Optional). If not provided, <text_field> will be searched starting at position 1.
>
>
<start_of_text> is the starting position in <text_field> to begin the search (Optional). If not PASSed or a blank/zero value is PASSed, <text_field> will be searched starting at position 1.
  <len_of_text> is the number of characters from <start_of_text> to be searched (Optional). If not provided, <text_field> will be searched to the end of the field.
Changed:
<
<
<start_of_search> is the starting position in <search_text> to use (Optional). If not provided, <search_text> starting at position 1 will be used.
>
>
<start_of_search> is the starting position in <search_text> to use (Optional). If not PASSed or a blank/zero value is PASSed, <search_text> starting at position 1 will be used.
  <len_of_search> is the number of characters from <start_of_search> to be used (Optional). If not provided, <search_text> will be used to the end of the field.
Changed:
<
<
<start_of_replace> is the starting position in <replace_with> to use (Optional). If not provided, <replace_with> starting at position 1 will be used.
>
>
<start_of_replace> is the starting position in <replace_with> to use (Optional). If not PASSed or a blank/zero value is PASSed, <replace_with> starting at position 1 will be used.
 
Changed:
<
<
<len_of_replace> is the number of characters from <start_of_replace> to be used (Optional). If not provided, <replace_with> will be used to the end of the field.
>
>
<len_of_replace> is the number of characters from <start_of_replace> to be used (Optional). If you PASS a zero or blank, <search_text> will be 'cut' from <text_field>. If not PASSed at all, <replace_with> will be used to the end of the field.
  Note this is a case sensitive search, regular expressions are not allowed.

Comments:

Revision 22012-03-26 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT FIND AND REPLACE

Line: 37 to 37
  <skip> is the number of occurrences of <search_text> to skip before beginning replacement (Optional). If not PASSed, all occurrences will be replaced.
Changed:
<
<
<max_no_replace> is the maximum number of replacements you want performed (Optional). If not provided, all occurrences will be replaced. For example, if you only want the first 2 occurrences replaced, PASS 0 for <skip> and 2 for <max_no_replace>, or if you only want the 3rd & 4th occurrences replaces, PASS 2 for <skip> and 2 for <max_no_replace>. You can also PASS -1 to indicate all occurrences.
>
>
<max_no_replace> is the maximum number of replacements you want performed (Optional). If not provided, all occurrences will be replaced. For example, if you only want the first 2 occurrences replaced, PASS 0 for <skip> and 2 for <max_no_replace>, or if you only want the 3rd & 4th occurrences replaced, PASS 2 for <skip> and 2 for <max_no_replace>. You can also PASS -1 to indicate all occurrences.
  <start_of_text> is the starting position in <text_field> to begin the search (Optional). If not provided, <text_field> will be searched starting at position 1.
Line: 51 to 51
  <len_of_replace> is the number of characters from <start_of_replace> to be used (Optional). If not provided, <replace_with> will be used to the end of the field.
Changed:
<
<
Notes this is a case sensitive search, regular expressions are not allowed.
>
>
Note this is a case sensitive search, regular expressions are not allowed.
 

Comments:

Read what other users have said about this page or add your own comments.

Revision 12012-02-10 - JeanNeron

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT FIND AND REPLACE

This subroutine finds and replaces text in a text/alpha field.


Usage:

      PASS         <text_field>               FIELD            SHARE? Y
      PASS         <search_text>              FIELD            SHARE? N
      PASS         <replace_with>             FIELD            SHARE? N
      PASS         <no_of_replacements>       FIELD            SHARE? Y
      PASS         <skip>                     FIELD            SHARE? N
      PASS         <max_no_replace>           FIELD            SHARE? N
      PASS         <start_of_text>            FIELD            SHARE? N
      PASS         <len_of_text>              FIELD            SHARE? N
      PASS         <start_of_search>          FIELD            SHARE? N
      PASS         <len_of_search>            FIELD            SHARE? N
      PASS         <start_of_replace>         FIELD            SHARE? N
      PASS         <len_of_replace>           FIELD            SHARE? N
      GOSUB    --- .TEXT FIND AND REPLACE
      *        Check for errors
      IF       --- .TEXT FIND AND REPLACE     NE

Description:

This subroutine finds and replaces text in a text/alpha field. The first 2 parameters are required. If any required parameters are missing, the subroutine will CANCEL.

<text_field> is the text to be modified (Required). This must be PASSed with Share "Y" to return the value.

<search_text> is the text to be searched for (Required).

<replace_with> is the replacement text (Optional). If not PASSed or blank, this routine will 'cut' the the <search_text> from <text_field>.

<no_of_replacements> returns the number of times the text was replaced (Optional). This must be PASSed with Share "Y" to return the value.

<skip> is the number of occurrences of <search_text> to skip before beginning replacement (Optional). If not PASSed, all occurrences will be replaced.

<max_no_replace> is the maximum number of replacements you want performed (Optional). If not provided, all occurrences will be replaced. For example, if you only want the first 2 occurrences replaced, PASS 0 for <skip> and 2 for <max_no_replace>, or if you only want the 3rd & 4th occurrences replaces, PASS 2 for <skip> and 2 for <max_no_replace>. You can also PASS -1 to indicate all occurrences.

<start_of_text> is the starting position in <text_field> to begin the search (Optional). If not provided, <text_field> will be searched starting at position 1.

<len_of_text> is the number of characters from <start_of_text> to be searched (Optional). If not provided, <text_field> will be searched to the end of the field.

<start_of_search> is the starting position in <search_text> to use (Optional). If not provided, <search_text> starting at position 1 will be used.

<len_of_search> is the number of characters from <start_of_search> to be used (Optional). If not provided, <search_text> will be used to the end of the field.

<start_of_replace> is the starting position in <replace_with> to use (Optional). If not provided, <replace_with> starting at position 1 will be used.

<len_of_replace> is the number of characters from <start_of_replace> to be used (Optional). If not provided, <replace_with> will be used to the end of the field.

Notes this is a case sensitive search, regular expressions are not allowed.

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->

-- JeanNeron - 2012-02-10

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback