Idea Details

RPGIV - Built in Functions for String Manipulation: %TRIM, %TRIML, %TRIMR

Last activity 12-04-2015 03:44 PM
Anon Anon's profile image
06-17-2011 07:50 AM

If RPGIV Add Ability to use Built in Functions %TRIM, %TRIML, %TRIMR


Comments

02-07-2015 12:57 AM

As I say - we could solve this as a community if there were a CA facility to receive such code fragments,  organise them, and even vote for 'best answers' that get shipped, whilst still leaving other examples on view.

Good point, Richard. I don't work currently with 2E, but your idea is very useful, for 2E or Plex. I think it merits to post it as an idea...

kindly

Jorge Ubeda

02-06-2015 04:55 AM

Given that a line of user source, incorporating parameters, can accomplish this, I feel it would be a waste of our scarce 2e development to engineer an expensive solution to this area.  I would expect that even adding to *Built in Functions would involve developer time.

 

However, I really, really  do think that its past time the product was shipped with examples of how to do this.

 

Without intending to hijack this idea, surely we could solve this at a stroke by shipping a notepad file or example file containing the necessary user source / functions

 

on file, say *Example code you discover %Trim intfun taking parameters #input string, #Input trim and #output string, and within the intfun the actual source call  mapping the parms to  #I and #O  something like

 

     #OABCD = %Trim(#IDCBA : #IWXYZ )

 

given that the example code has named the #I and #O work parameter fields to the function accordingly.

 

 

Some may say that trimming could usefully be a procedure, especially so where the target is maybe an address field, which must be held in a fixed field, but frequently trimmed for presentation..

 

As I say - we could solve this as a community if there were a CA facility to receive such code fragments,  organise them, and even vote for 'best answers' that get shipped, whilst still leaving other examples on view.  If CA massage the field names to use 'reserved' names, then we could download them and CPYIMPOBJ into models.

 

What a time saving!  and so much easier for a newcomer to use.

 

Just sayin'

 

Richard Wilson

07-18-2011 04:08 PM

I wouldn't limit this to just RPGIV or even to just these built in functions, but would provide functions or subroutines to do this in the other languages where necessary.  These functions are very useful when handling strings.