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

  • Thread starter Thread starter Dileep Dasa
  • Start date Start date
Status
Not open for further replies.
D

Dileep Dasa

Guest
Small change in Bill Wood 's code (ENTRY function needs position as first argument and list as second argument): DEF VAR list AS CHAR INITIAL "a,b,c,d,e". /* 5 entries */ DEF VAR entry2ndFromLeft AS CHAR. DEF VAR entry2ndFromRight AS CHAR. DEF VAR pos AS INTEGER INITIAL 2. /* The 2nd ENTRY is easy going LEFT-to-RIGHT */ entry2ndFromLeft = ENTRY (pos, list). /* 'b' */ /* To get 2nd from Right, just use NUM-ENTRIES and subtraction. */ entry2ndFromRight = ENTRY (NUM-ENTRIES(list) + 1 - pos, list). /* 'd' */

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