How to convert A00073 value to 9973 in progress 4gl

前端 未结 5 1868
日久生厌
日久生厌 2021-01-29 04:37

i have column having multiple value like A0045 ,A00065 . i want to convert it 9945, 9965. Need to remove all 0 and character value and add 99 before that value.. Please help..

5条回答
  •  天涯浪人
    2021-01-29 05:06

    define variable word as character no-undo.

    define variable i as integer no-undo.

    assign word = "A00065".

    /*******To Remove all the zero********/

    word = replace(word,substring(word,index(word,"0"),(r-index(word,"0") - 1)),"").

    do i = 65 to 90: if substring(word,1,1) = chr(i) then do:

      word = replace(word,substring(word,1,1),"99").
      leave.
    

    end.

    end.

    display word.

提交回复
热议问题