欢迎来到天天文库
浏览记录
ID:55632181
大小:347.50 KB
页数:48页
时间:2020-05-21
《RPGIV 程序员面试初级题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、RPGIV程序员面试初级题288 (1) HowdoItrimleadingzeroes?IsthereaBIFtotrimleading0'soffofanumericfieldANDreducethefieldsizeaccordingly? i.e.afieldwithavalueofIwanttoprint:"value:12345" insteadof"value:" or"value: 12345"Answer:Useacombinationof%editand%trim.The%editBIFwilledityournumberanywayyouwish
2、:suppressleadingzeroes,addcommas,etc.The%trimBIFwillstriptheblanksoffthefront.Typicaluseforthisistoinsertanumericamountintoamessage,like"Yourbalanceis$25.00"(2) %sizegivesmeacompiletimeerroronmyDspecs%sizedoesn'tacceptanexpressioninDspecs; Try %leninstead.(3) %trimisveryslow,Ididaquickietestoft
3、hisonmyheavilyloaded620.5000loopsof%trim(String)."String"containstheliteral"A":Answer:If"String"isdeclared20byteslong,ittakes01.Tryvariablelengthfieldsforyourstringmanipulationchores.(4) HowcanIrightjustifyafield?Answer:ForV4R4andabove:C Evalr output=%trimr(input)Forearlierre
4、leases:C Eval output= %subst(FLDBLANKS:1:%len(input)-%len(%trimr(input)))+Inputwhere"input"and"FLDBLANKS"areequallengthcharacterfields.(5) HowcanIcentreafield?Basically,takehalfthelengthoftheoutputfield,subtracthalfthelengthofthetrimmedinputfield,putthatmanyblanksatthefr
5、ontoftheoutputfieldandaddtheinputfield.Watchoutforoutputsizelessthaninputsizeandblankinput!dinput s 24 inz(' ')doutput s 40 inzdBLANKS s like(output)inzdlen s 10i0c
6、 eval len=(%len(output)/2)– %len(%trimr(input))/2c if len+%len(%trimr(input))<= %len(output)c eval output=%subst(BLANKS:1:len)+inputc elsec eval output=inputc endif(6) Does%lencountt
7、henullinanullterminatedstring?Answer:No.(7) IgetRNX0112whenIuseL(date)datatypeswithCAnninmydisplayfile.IfyouuseCAnninsteadofCFnn,thiswillhappenbecauseofthewaytheI/ObufferisvaliditycheckedbytheRPGruntime.WhentheuserusesaCFkey
此文档下载收益归作者所有