Forum Post: RE: is there a 'reverse' ENTRY function in ABL?

  • Thread starter Thread starter jmls
  • Start date Start date
Status
Not open for further replies.
J

jmls

Guest
or, converting the whole thing into a class using the power of ABL OO : using Progress.Lang.*. routine-level on error undo, throw. class whoGloo.utils.string: method static char R-ENTRY(p_pos as int,p_list as char ): return R-ENTRY(p_pos,p_list,",":u). end method. method static char R-ENTRY(p_pos as int,p_list as char,p_delimiter as char ): if p_pos eq ? or p_list eq ? or p_delimiter eq ? then return ?. if p_pos le 0 or num-entries(p_list,p_delimiter) lt p_pos then undo, throw new Progress.Lang.AppError(substitute("entry &1 is outside the range of list &2", p_pos, p_list),560). return entry(num-entries(p_list) + 1 - p_pos,p_list). end method. end class. you can then do using whoGloo.utils.string. message string:R-ENTRY(3,"a,b,c,d") view-as alert-box.

Continue reading...
 
Status
Not open for further replies.
Back
Top