PeopleCode变量名都以&开头,缺省的局部变量类型为ANY。当返回数据类型不确定时为ANY,由PeopleTools决定其类型。
Local Any &Example_Any;
Local String &Test;
Local String &Test2;
&Example_any = "TEST";
&Example_Any = &Test | ' ' | &Test2;
/*%Date:今天*/
&Example_any = %Date;
BOOLEAN: TRUE(1) or FALSE(0).
LOCAL BOOLEAN &B_test;
&B_test = False;
DATE: YYYY-MM-DD
DATETIME: YYYY-MM-DD-HH.MI.SS.SSSSSS
TIME: HHMISS
NUMBER: 整数或者小数
&Number_example1 = 456;
&Number_example2 = 456.78;
&Number_example3 = 0.45678;
&Number_example4 = -456.78;
FLOAT: 浮点小数
INTEGER: 整数,32位有符号数;PeopleCode中除法运算即使定义成INTEGER不会用到INTEGER,而是用浮点数
Local INTEGER &Sample1, &Sample2, &Sample3;
&Sample1 = 44;
&Sample2 = 11000;
&Sample3 = -2200;
STRING: 可以使用单引号或者双引号
&sample_string = "Now is the time for all good men to come to the aid of their country";
&sample_string2 = "Now is the time for all good men to come to the aid of their country 'string within a string' declaration";
&sample_string3 = "Now is the time for all good men to come to the aid of their country "double quoted string within a string" declaration";
OBJECT:
PeopleCode Data Buffer Access Types: Field, Record, Row, Rowset.
PeopleCode Display Data Types: AnalyticGrid, Chart, Grid, GridColumn,Page
PeopleCode Internet Script Data Types: Cookie, Request, and Response
PeopleCode Miscellaneous Data Types: AESection, AnalyticInstance, Array, Crypt, Exception, File, Interlink, BIDocs, JavaObject (can only be declared as type Local), Message, MCFIMInfo, OptEngine, PostReport, ProcessRequest, RowsetCache, SoapDoc, SQL, SyncServer, TransformData(can only be declared as type Local), XmlDoc, and XmlNode (objects can only be declared as type Local)
Global ApiObject Data Type Objects: Session, PSMessages collection, PSMessages, all tree classes (trees, tree structures, nodes, levels, and etc.), query classes.
Local ApiObject Data Type Objects: Meta SQL, Meta HTML, System Variables, and RowSet