rpgiv程序员面试初级题288

rpgiv程序员面试初级题288

ID:23141638

大小:298.69 KB

页数:63页

时间:2018-11-04

rpgiv程序员面试初级题288_第1页
rpgiv程序员面试初级题288_第2页
rpgiv程序员面试初级题288_第3页
rpgiv程序员面试初级题288_第4页
rpgiv程序员面试初级题288_第5页
资源描述:

《rpgiv程序员面试初级题288》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、RPG/V程序员面试初级题288⑴Howdo■trimleadingzeroes?Istherea巳IFtotrimleading0'soffofanumericfieldANDreducethefieldsizeaccordingly?i.e.afieldwithavalueof0000123451wanttoprint:’’value:12345”insteadof’value:000012345”orHvalue:12345”Answer:Useacombinationof%editand%trim.The%edit

2、BIFwilledityournumberanywayyouwish:suppressleadingzeroes,addcommas,etc.Theo/otrimBIFwillstriptheblanksoffthefront.Typicaluseforthisistoinsertanumericamountintoamessage,like"Yourbalanceis$25.00”(2)%sizegivesmeacompiletimeerroronmyDspecs%sizedoesn’tacceptanexpressio

3、ninDspecs;Try%leninstead.(3)%trimisveryslow,Ididaquickietestofthisonmyheavilyloaded62CL5000loopsofo/otrim(String).’’String”containstheliteral’’A”:Answer:If’’String’’isdeclared20byteslong,ittakes01.Tryvariablelengthfieldsforyourstringmanipulationchores.(4)Howcan■ri

4、ghtjustifyafield?Answer:ForV4R4andabove:CEvalroutput=%trimr(input)Forearlierreleases:CEvaloutput=%subst(FLDBLANKS:1:%len(input)-%len(%trimr(input)))+Inputdlenwhere"input"and”FLDBLANKS”areequallengthcharacterfields.(2)Howcan■centreafield?Basically,takehalfthelength

5、oftheoutputfield,subtracthalfthelengthofthetrimmedinputfield,putthatmanyblanksatthefrontoftheoutputfieldandaddtheinputfield.Watchoutforoutputsizelessthaninputsizeandblankinput!dinput24inz(.1234567890*)doutput40inzdBLANKSslike(output)inz10i0evallen=(%len(output)/2)

6、-%len(%trimr(input))/2iflen4-%len(%trimr(input))<=%len(output)evaloutput=%subst(BLANKS:1:len)+inputelseevaloutput=inputendif(3)Does%lencountthenullinanullterminatedstring?Answer:No.(4)IgetRNX0112whenIuseL(date)datatypeswithCAnninmydisplayfile.IfyouuseCAnninsteadof

7、CFnn,thiswillhappenbecauseofthewaytheI/ObufferisvaliditycheckedbytheRPGruntime.WhentheuserusesaCFkey/ENTER/etc.thecurrentdisplayvaluesaremovedtothisWBandverified.Don’tuseCAkeysorDon'tusefunctionssuchasVALUES,RANGE,CHECK(VN),etc.AsDatevaliditycheckingisdoneinthesam

8、emannerastheseotherDDSkeywords(thatis,inWSDMandnottheworkstationcontroller)itfallsintothesameclassification.(2)ErrorhandlingI’musingthe*PSSRandwanttoret

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。