RPGIV 程序员面试初级题.doc

RPGIV 程序员面试初级题.doc

ID:55632181

大小:347.50 KB

页数:48页

时间:2020-05-21

RPGIV 程序员面试初级题.doc_第1页
RPGIV 程序员面试初级题.doc_第2页
RPGIV 程序员面试初级题.doc_第3页
RPGIV 程序员面试初级题.doc_第4页
RPGIV 程序员面试初级题.doc_第5页
资源描述:

《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

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

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

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