Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1559 closed Feature Request (Fixed)

StringRegExpReplace - add Return Value in Helpfile

Reported by: script4ever Owned by:
Milestone: Future Release Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

There are no Return Value in HelpFile for StringRegExpReplace.

This may be added:

Success: Returns array of matches. \0 contains input string. 
Failure/no match: Returns input string. 

Attachments (0)

Change History (5)

comment:1 Changed 15 years ago by script4ever

Return Value for Success should be mentioned:

Success: Returns replaced string. Replace expression \0 contains the full match. 

comment:2 Changed 15 years ago by Jpm

not sure to understand the "Replace expression \0 contains the full match"

comment:3 Changed 15 years ago by GEOSoft

JP
"\0" or "$0" as the replacement value will return the original string which is totaly usless IMHO. If I wanted the original string, why did i bother with any replace function?

The part that gets confusing is where script4ever says
"Success: Returns array of matches. \0 contains input string."
he may have meant [0] contains the original string but either way it's incorrect as far as I know. StringRegExpReplace() returns a string, not an array.
The part about
"Failure/no match: Returns input string."
Should probably be
"Failure/no match: Returns original string."
But that is just sematics.

Where he is correst is that both the successful return and the failure are missing from the documentation. All that is there is the @Error Values.

"Success: Returns the modified string. Check @Extended for the number of replacements performed.
Failure: Sets @Error to 2, pattern invalid. Check @Extended to get the offset of the error in the pattern."
along with, or in place of the current @Error Values is probably more appropriate.

comment:4 Changed 15 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from new to closed

Thanks George,
I can close it now as I have updated the doc almost the same way as you suggest.

comment:5 Changed 15 years ago by TicketCleanup

  • Milestone set to Future Release

Automatic ticket cleanup.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.