你可以通过在字段右边的输入〉来使字段向后移动,你输入〉符号的数量就是字段向右移动的位移量,向左是同样的道理。
Centeringafield字段居中
Tocenterafieldonthescreenplacean'ac'attheleftofthefieldandthe'c'mustbeoverlappingthefirstcharacterofthefield.ThenpressEnter.
PressF3tofinisheditingthisrecord.Chooseoption1tosaveyourwork:
要是想将字段居中,你可以在字段的左边输入ac,c必须覆盖字段字段的第一个字符,然后按下回车,按下F3结束你对字段的编辑,选择1保存你的工作成果。
CreateanotherrecordnamedBOTTOM,thesamewayyou'vecreatedtheTOPrecord.
现在我们创建另外一个记录叫做Bottom,方法是跟创建TOP字段是一样的。
WhenyouopenthenewrecordforeditingpressF9.Thismenuwillappear:
当你打开按下F9对新的记录,我们可以看见菜单显示出来了
Sothatyoudon'toverlaptherecordsyoucanchoosetovisualizeotherrecordsinthemenu.YoucanseethatthestatusoftheBOTTOMrecordis“InUse”whichmeansitistheonecurrentlybeingedited.Youcanselectatmost3recordstovisualize.Todosoplacenumbers1to3ontherecordsyouwant.SelecttheTOPrecordandpressEnter.
为了不要覆盖你的其他记录,你可以选择在菜单中对其他记录可视化,你可以发现Bottom记录处于正在使用“InUse”状态,意味着这正是我们正在编辑的记录,你可以选择最到3条记录进行可视化,将1,2,3放在你想可视化的记录上面,然后按回车
Thenamesoftheselectedfieldsappearonthebottomofthescreen.Don'tforgetyouareonly“drawing”ontherecordinuse.Theotherrecordsonlyhelpyouplaceyourelementsontherightplace.
可以看到,你所选的字段显示在屏幕的底部了,但是你不要忘记了,你只能“草绘”那个正在使用(“InUse”)的记录,其它记录只能辅佐那个正在使用的字段放置合适的位置而已。
“Draw”somethingsimilartowhatyouseeinthenextimage.Usetheunderscoretomaketheline.
像下图那样“草绘”我们的需要的界面,我们使用下划线描述出一条直线来
Changingfieldproprieties修改字段属性
We'regoingtoedittheproprietiesofthe“F3=Exit”field.Placean'*'attheleftofthefieldandpressEnter:
我们现在修改“F3=Exit”字段的属性,在这个字段的左边输入*,然后按下回车。
Thisscreenappears.Placean'Y'intheColorsoption.We'regoingtochangethecolorofthecharacters.
当出现了下面的界面,在颜色选项中输入Y,
Placean1intheBluefield:
在蓝色选项那里输入1
Selectbluecolor选择蓝色
PressEnteruntilyou'rebackintheeditingscreen.Thefieldisnowblue.Exittheeditingscreen(F3)andsaveyourwork.
按回车返回,直至你返回编辑界面,现在可以看到字段已经变成蓝色了,按F3退出编辑界面然后保存你的工作成果。
Createanewrecord,MIDDLE,thesamewayyou'vecreatedthepreviousrecords.
创建一个新的记录,MIDDLE,方法跟你之前的事一样的
PressF9tovisualizetherecordsyoualreadycreated:
按F9可视化你刚刚创建的记录
Drawwhatyoucanseeinthefollowingimage.PressEnterwhenyou'redone.
按照下图草绘界面,完成后按回车
Addfields
添加字段
Usingtablerecords
使用表记录
We'regoingtoselectthefieldsfromtheClientstabletoshowthemonthescreen.PressF10.OnthatmenuselecttheDatabaseFileClientsforoutput(option3).Youcanalsoselectfieldsforinputorinput/outputchoosingoneoftheotheroptions.YoushouldwritethisonthemenuandpressEnter:
现在我们将要在客户表中选择我们想要的字段,将他们显示在界面上面,按下F10,现在第3项(selecttheDatabaseFileClientsforoutput),你也可以为其它的选项,选择字段作为输出和输入。
Selectthetable选择表
Onthebottomofthescreenthere'samessagewithalltheClient'sfieldnamesprecededbyanumber.Touseafieldonthescreenyoushouldwriteitscorrespondentnumberprecededwithan'&'.Youcanseeitinthenextimage.Becareful,becauseifyouwriteanumberandpressEntertheorderofthelistonthebottomwillchange.
在下图中,你可以看到一条信息显示在最下面,显示了客户表的所有字段和字面名字前面附带着号码,要将这些字段显示在界面的,你需要将相关的字段的号码写在屏幕界面上,前边带上一个‘&’的符号,如下图,
Thefinalresult:
最后结果
Exittherecordediting.Wenowneedtomakeafewadjustmentstothefileoptions.
推出记录编辑,我们需要对文件选项进行一些修改
Recordleveloptions(overlay)记录层面选项(覆盖)
Chooseoption8totheTOPrecord:
在Top记录选择选项8
Changeoverlayoption修改覆盖选项
SelectoptionOverlayKeywords:
选择覆盖关键字
Changeoverlayoptionstep2修改覆盖选项第二步
PlaceanYattheoptionOverlaywithouterasing.Thisoptionallowstodisplaythisrecordonthescreentogetherwiththeothers.PressEnteruntilyoureachthemenuwiththerecordlisting.Activatethisoptionontheotherrecords.
在选项(Overlaywithouterasing)的地方输入Y,这个选项允许你在屏幕界面中同时显示其他的记录。
一路回车直至你看到记录列表,在其他界面中激活这个选项
Changeoverlayoptionstep3
修改覆盖属性步骤3
Fileleveloptions(indicators)文件层面的选项(指示器)
Weneedtodeclaretheindicator03(sothat“F3=Exit”works)atthefilelevel.OnthemenuwiththerecordlistingpressF14(F13=shift+F1;F14=shift+F2;F15=shift+F3,etc.).OnthefollowingscreenchoosetheoptionIndicatorKeywords.
要实现“F3=Exit”的功能,我们需要需要在文件的层面声明指示器03,在字段列表的菜单中我们输入F14(F13=shift+F1;F14=shift+F2;F15=shift+F3,etc.).然后,我们选择指示器选项关键字,如下图
Insertthedatayouseeontheimagebelow:
按照下图输入
PressEnteruntilyou'vereachedthestartingmenu.PressF3andsavethefile.
一路回车直至看到开始菜单,按F3保存文件。
DisplayFilesDDScode显示DDS文件的代码
YoucancheckoutthecodefromthisdisplayatQDDSSRC,thememberisSHW_CLI.Atthebeginningofthefileshouldbesomethinglikethis:
你可以查看上面步骤产生的DDS代码,位置在QDDSSRC,成员名字是SHW_CLI,在文件的开头我们可以看到这样两行:
ADSPSIZ(2480*DS3)
ACF03(03'Exit')
Thesearethefile-leveloptions.Youshouldaddalinetothisareathatlaterwillallowyoutorenametheindicatorsused.AddthislineaftertheDSPSIZline:
这是文件层面的选项,你迟些可以在这里增加一行,它允许你重命名这个已经用了的指示器,在DSPSIZ后面添加一行,如下
AINDARA
Youshouldalsohavesomelineslikethese:
你也可以添加几行像下面的:
ARTOP
AOVERLAY
A165USER
A327'ClientDetails:
'
InthesefourlinesarethedefinitionstotheTOPrecord.NoticetheOVERLAYoptionwehaddefinedinSDA.ThekeywordUSERisplacedonthe1stline,column65.
上面四行是关于TOP记录的定义,要注意的是OVERLAY选项是我们在SDA中定义的,关键字USER被放在第一行,第65列。
LookatthislinefromMIDDLErecord:
现在我们看看MIDDLE的记录
AID_CLIRO823REFFLD(CLIENTS/ID_CLIDEMO/CLIENTS)
HereyouhaveareferencetotheID_CLIfieldontheCLIENTStableandthisreferenceispositionedatline8column23,ancanonlybeaccessedforreading(O).
这里你定义了一个引用,指向CLIENTS表的ID_CL字段,这个字段的位置在第8行,第23列,是一个只读的字段。
Compilethefile(option14)afteryou'veclosedthemember.
关闭了这个成员之后,你可以按F14编译这个文件。
Executingdisplayfiles执行显示文件
TorunthescreenyoumustcreateanRPGLEmemberwhichwillhandleallthepossibleevents(pressingF3forexample).CheckoutthefileQRPGLESRC.SHW_CLItoseehowthismembershouldbedefined.CreateafilelikeQRPGLESRC.SHW_CLIandrunit.Theresultshouldbesomethinglikethis:
要运行这个界面,你必须创建一个RPGLE成员,来处理所有可能的事件(例如按下F3),打开文件QRPGLESRC.SHW_CLI,看看我们英文怎么定义这个成员,创建一个像QRPGLESRC.SHW_CLI文件,然后我们运行,结果如下图,