Easy way to pick elements? - Forum - OpenEdge Development - Progress Community
 Forum

Easy way to pick elements?

This question is not answered

11.7

Having strings like this:

e:\progress\{MedlemsNr}\logg{Klientnr}

where {xxxx} is elements that I need to pick and check, what whould be the easiest way doing that?

I could use do i = 1 to num-entries(stringX,'{'):

  Element = '{' + substring(entry(i,stringX,'{'),1,index(entry(i,stringX,'{'),'}').

but I wonder if there is other ways that could be easier?

//Geir Otto 

All Replies
  • I would probably used '}' instead to test for elements....

  • I do:

    inNE = NUM-ENTRIES(data,'~{').

    DO inInd = 1 TO inNE:

    toTest =ENTRY(inInd,data,'~{').

    IF NUM-ENTRIES(toTest,'}') LE 1 THEN /* it should never be LT 1.. but..*/

      NEXT.

    found = ENTRY(toTest,'}').

    END.

  • 😊 that was easier then the one I made, but still more or less the same. I was wondering if there was a .Net way using Array or something like that 😊
     
    //Geir Otto
     
  • I just found I've asked same question here

    community.progress.com/.../38133