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