如何将A0058值转换为进行中的9958 4gl [英] How to convert A0058 value to 9958 in progress 4gl

查看:98
本文介绍了如何将A0058值转换为进行中的9958 4gl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i具有具有多个值的列,如A0045,A00065.我想将其转换为9945、9965.需要删除所有0和字符值,并在该值之前添加99. replace(val,"A","99")仅替换我要进行A-Z出现的A.任何字符都应转换为..请帮助

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.. replace(val,"A","99") will replace only A I want to go for A-Z occurrence.. Any char should be convert .. Please help

推荐答案

/************Try this*********************/

define variable word as character no-undo.

define variable i as integer no-undo.

assign word = "A00065".

/******to remove all the zeroes**************/

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.

这篇关于如何将A0058值转换为进行中的9958 4gl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆