锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
聽
SELECT myNum, SUM(myValue) FROM anotherTable GROUP BY myNum WHERE myNUM <= 100;
---------------------------
return [#CurrentVersion, #CurrentList];
---------------------------
if (typeof(conPeek(packedClass,1)) != Types::INTEGER)
---------------------------
new MenuFunction(menuItemDisplayStr(SalesTable), MenuItemType::Display).run(args);
---------------------------
Query querySalesTable;
聽聽聽 querySalesTable.dataSourceTable(tableNum(SalesTable)).addRange(fieldNum(SalesTable, InterCompanyOrder)).value(queryValue(NoYes::Yes));
---------------------------
Common聽聽聽聽聽 common;
聽聽聽 ;
聽聽聽 this.handleDeleteActions(sysDictTable);
聽聽聽 common = sysDictTable.makeRecord();
聽聽聽 common.skipDatabaseLog(true);
聽聽聽 common.skipDataMethods(true);
聽聽聽 common.skipDeleteActions(true);
聽聽聽 delete_from common;
----------------------------
Dictionary聽聽聽聽聽 dictionary = new Dictionary();
tableId = dictionary.tableNext(tableId);
----------------------------
tableNum(SalesTable):
----------------------------
MyTable myTable;
RecordInsertList insertList = new RecordInsertList(myTable.TableId, True);
int i;
for ( i = 1; i <=聽 100; i++ )
{
myTable.value = i;
insertList.add(myTable);
}
insertList.insertDatabase();
}
-----------------------------
int p2 = strFind(line,' ',p1,strLen(line));
return subStr(line,p1,p2-p1);
----------------------------------
聽if (o && (o.handle() == classIdGet(fr))
--------------------------------
return (dictFeatureKey.rights() != AccessType::NoAccess) ? true : false;
-------------------------------
kmQuestion.answerInputType聽聽聽聽聽 = KMQuestionAnswerInputType::CheckBox;
kmQuestion.answerInputType聽聽聽聽聽 = KMQuestionAnswerInputType::ComboBox;
kmQuestion.answerInputType聽 = KMQuestionAnswerInputType::RadioButton;
kmQuestion.answerInputType聽聽聽聽聽 = str2Int(kmQuestion.DEL_answerModeSelection);
--------------------------------
select sum(correctAnswer) from KMVirtualNetworkAnswerLine
聽聽聽聽聽聽聽 group by kmVirtualNetworkAnswerTableId, kmQuestionResultGroupId
--------------------------------
kmConnectionType.refFieldId = fieldNum(HRMCourseTable, description);
--------------------------------
segment += ':' + date2str(_date,321,2,0,2,0,4)+ subStr(time2str(_time,1,1),1,2) +
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 subStr(time2str(_time,1,1),4,2) + subStr(time2str(_time,1,1),7,2);
--------------------------------
Dialog聽聽 dialog聽聽聽聽聽聽聽聽聽聽聽 = new Dialog("@SYS73363");
DialogField聽聽聽聽 dlgClassTypeName聽 = dialog.addField(typeId(className));
Editor editor
--------------------------------
聽filename = WinAPI::getSaveFileName(0, ['Text','*.txt'], '', "@SYS56237", 'txt', defaultName );
聽聽聽 if (filename)
聽聽聽 {
聽聽聽聽聽聽聽 io = new AsciiIo(filename, 'W');
聽聽聽聽聽聽聽 io.write(EditorScripts::getSelectedText(e));
聽聽聽 }
---------------------------------
switch (version)
聽聽聽 {
聽聽聽聽聽聽聽 case(#CurrentVersion) :
聽聽聽聽聽聽聽聽聽聽聽 [version,#CurrentList,packedQuery] = packedClass;
聽聽聽聽聽聽聽聽聽聽聽 if (packedQuery)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 qr = new QueryRun(packedQuery);
聽聽聽聽聽聽聽聽聽聽聽 break;
聽聽聽聽聽聽聽 default :
聽聽聽聽聽聽聽聽聽聽聽 return false;
聽聽聽 }
--------------------------------
select workCalendarDateLine
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 index CalendarDateFromIdx
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 where workCalendarDateLine.calendarId聽聽 == calendarId
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 && workCalendarDateLine.transDate聽聽聽 == transDate
---------------------------------
#define.dateFormat('DD/MM/YYYY hh:mm:ss')
default:
聽聽聽聽聽聽聽聽聽聽聽 warning(strFmt("@SYS24561",classIdGet(gantt)));
--------------------------------
聽AsciiIo logFile = new AsciiIo(#VTHeapLog, 'a');
聽聽聽 ;
聽聽聽 logFile.write(this.prompt('聽 Unfreed object'), conPeek(data,2));
--------------------------------
select firstonly ledgerPeriod
聽聽聽聽聽聽聽 order by periodStart desc
聽聽聽聽聽聽聽 where ledgerPeriod.periodStart聽 <= _transDate聽聽 &&
聽聽聽聽聽聽聽聽聽聽聽聽聽 ledgerPeriod.periodCode聽聽 == _periodCode;
---------------------------------
client server static boolean checkFailed(SysInfoLogStr txt, URL helpURL = '', SysInfoAction _sysInfoAction = null)
{
聽聽聽 if (BMMainControl::inAction())
聽聽聽聽聽聽聽 appl.BMaddInfo(Exception::Info,txt);
聽聽聽 else
聽聽聽聽聽聽聽 infolog.add(Exception::Warning, getprefix()+txt, helpURL, _sysInfoAction, false);
聽聽聽 return false;
}
------------------------------------
switch(itemCode)
聽聽聽 {
聽聽聽聽聽聽聽 case TableGroupAll::Table聽聽聽聽聽聽 :聽聽 return item;
聽聽聽聽聽聽聽 case TableGroupAll::GroupId聽聽聽聽 :聽聽 return groupId;
聽聽聽聽聽聽聽 case TableGroupAll::All聽聽聽聽聽聽聽聽 :聽聽 return '';
聽聽聽 }
TableGroupAll::Table//鏄釜鏋氫婦綾誨瀷錛坆ase enum錛?br />------------------------------------
void聽 new(CurrencyCode聽 _currencyCode)
{;
聽聽聽 currencyCode聽聽聽聽聽聽聽聽聽聽聽 = _currencyCode;
聽聽聽 exchRate聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 = 0;
聽聽聽 exchrateSecondary聽聽聽聽聽聽 = 0;
聽聽聽 exchRatesTriangulation聽 = UnknownNoYes::Unknown;
}
//褰撳緩绔嬩竴涓璞$殑鏃跺欎細璋冪敤姝ゆ柟娉?br />------------------------------------
// Create a list iterator
it = new listIterator (il);
聽聽 print it.definitionString(); // prints 鈥渋nt list iterator鈥?br />聽聽 print it.toString(); // prints 鈥?begin)[4]鈥?br />// Go on for as long as elements are found in the list...
while (it.more())
聽聽 {
// fetch the next element
print it.value(); // prints 4 2 1
it.next();
聽聽 }
print it.toString();聽聽聽 // prints (end)
pause;
聽聽聽 int i=0;
聽聽聽 str name="XMDDL369";
聽聽聽 real r_i=23.789;
聽聽聽 boolean b=false;
聽聽聽 date d1=11\11\2000;
聽聽聽 date d3 = 21\11\1998;
聽聽聽 Integer s=90;
聽聽聽 int a_i[3];
聽聽聽 a_i[0]=1;
聽聽聽 //驢錄虜茅祿霉鹵戮碌脛脢媒戮脻脌脿脨脥攏盧錄爐潞脧脌脿脨脥
聽聽聽 //脠莽潞脦脥簍鹿媒脌脿脠隆碌脙脢媒戮脻驢芒碌脛脕盧陸脫攏盧路碌祿脴錄脟脗錄錄爐潞
聽聽聽 //脪矛魯攏碌脛虜露脳陸潞脥麓婁脌鉚
聽聽聽 //鹵盲脕驢碌脛脳梅脫脙脫貌
聽聽聽 //int a_j[3]={1,2,3};
聽聽聽 //*********************
聽聽聽 print hw.sayHello()+" XMDDL369";
聽聽聽 while(i<10){
聽聽聽聽聽聽聽 print i;
聽聽聽聽聽聽聽 i++;
聽聽聽 }
聽聽聽 print name;
聽聽聽 print r_i;
聽聽聽 //print any2str("90.9")+name;
聽聽聽 if(b==true)
聽聽聽聽聽聽聽 print "b is true";
聽聽聽 else
聽聽聽聽聽聽聽 print "b is not true";
聽聽聽 print d3;
聽聽聽 print dayofmth(d3);
聽聽聽 print dayofwk(d3);
聽聽聽 print dayofyr(d3);
聽聽聽 print s;
聽聽聽 hw.sayWorld();
聽聽聽 try
聽聽聽 {
聽聽聽聽聽 print i/0.9;
聽聽聽 }
聽聽聽 catch (exception::error)
聽聽聽 {
聽聽聽聽聽聽 print "鹵祿 0 魯媒";
聽聽聽 }
聽聽聽 ///////////////////////////
聽聽聽 ////////脢媒戮脻驢芒虜脵脳梅//////////
聽聽聽 ////////////////////////////
聽聽聽 //hw.find();//虜茅脩爐脢媒戮脻驢芒脠隆碌脙錄脟脗錄
聽聽聽 //hw.insert();聽 //脭枚隆壟脡戮隆壟賂脛隆壟虜茅攏簍CRUD攏漏
聽聽聽 //hw.update();
聽聽聽 //hw.delete();
聽聽聽 hw.executeBySQL(sql);
}
錛?錛塵ethod find錛堬級錛?br />void find()
{
聽聽聽 UserInfo ui;
聽聽聽 select ui where聽 ui.name=="xmddl";
聽聽聽 print ui.password;
聽聽聽 while select ui
聽聽聽 {聽聽 //虜茅脩爐脣霉脫脨碌脛錄脟脗錄
聽聽聽聽聽聽聽 print ui.name+"聽 "+ui.Id;
聽聽聽 }
}
錛?錛夈乵ethod delete錛堬級錛?br />void delete()
{
聽聽聽 Userinfo ui;
聽聽聽 ttsbegin;
聽聽聽 select forupdate ui where ui.Id=="new";
聽聽聽 //ui.Id="new";
聽聽聽 ui.delete();
聽聽聽 //ui.doDelete();
聽聽聽 ttscommit;
}
錛?錛夈乵ethod update錛堬級錛?br />void update()
{
聽聽聽 Userinfo ui;
聽聽聽 ttsbegin;
聽聽聽聽聽聽聽 select forupdate ui where ui.id=="new";
聽聽聽聽聽聽聽 ui.name="xmddl369";
聽聽聽聽聽聽聽 ui.password="hello new";
聽聽聽聽聽聽聽 ui.update();
聽聽聽 ttscommit;
}
錛?錛夈乵ethod insert錛堬級錛?br />void insert()
{
聽聽 Userinfo ui;
聽聽 ttsbegin;
聽聽 ui.Id="new";
聽聽 ui.name="xmddl";
聽聽 ui.insert();
聽聽 ttscommit;
聽聽聽 /* 脜煤脕驢賂眉脨脗
聽聽聽 MyTable myTable;
聽聽聽 RecordInsertList insertList = new RecordInsertList(myTable.TableId, True);
聽聽聽 int i;
聽聽聽 for ( i = 1; i <=聽 100; i++ )
聽聽聽 {
聽聽聽聽聽聽聽 myTable.value = i;
聽聽聽聽聽聽聽 insertList.add(myTable);
聽聽聽 }
聽聽聽 insertList.insertDatabase();//<-----this is
聽聽聽 */
}
錛?錛塵ethod executeBySQL錛堬級錛?br />void executeBySQL(Str sql)
{
聽聽聽 Connection con=new Connection();
聽聽聽 Statement stmt=con.createStatement();
聽聽聽 ResultSet rs=stmt.executeQuery(sql);
聽聽聽 //stmt.executeUpdate(sql);
聽聽聽 while(rs.next()){
聽聽聽聽聽聽聽 print "SQL "+rs.getString(1);
聽聽聽 }
}
聽聽聽聽聽for(m=0;m<10;m++){//can not define int m=0 in this
聽聽聽聽聽聽聽聽聽聽print m;
聽聽聽聽聽聽聽}
4銆佸紑鍙戠幆澧冩瑙堬細
int main(){
聽cout<<"Hello World\n";
聽return 0;
}聽
錛?錛夊熀鏈暟鎹被鍨?63涓叧閿瓧
char聽聽聽聽聽聽聽聽聽聽聽聽聽 1b
wchar-1聽聽聽聽聽聽聽聽 2b
int(16bit)聽聽聽聽聽聽聽 2b
int(32bit)聽聽聽聽聽聽聽 4b
float聽聽聽聽聽聽聽聽聽聽聽聽聽 4b
double聽聽聽聽聽聽聽聽聽聽聽 8b
bool聽聽聽聽聽聽聽聽聽聽聽聽聽聽 N/A
void聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽N/A
錛?錛夋敞閲婄被浼糲
錛?錛夎漿涔夊瓧絎?br />\b閫鏍?br />\f鎹㈤〉
\n鎹㈣
\r鍥炶濺
\t姘村鉤鍒惰〃
\"鍙屽紩鍙?br />\'鍗曞紩鍙?br />\\鐮存姌鍙?br />
\v鍨傜洿鍒惰〃絎﹀彿
\a鍠囧彮鍡¢福
\?闂彿
\N鍏繘鍒跺父閲?br />\xN鍗佸叚榪涘埗甯擱噺
錛?錛夎繍綆楃錛岀被浼糲
錛?錛夌▼搴忔帶鍒惰鍙ワ紝綾諱技c
錛?錛夊瓧絎︿覆鍜屾暟緇?br />錛?錛夋寚閽?br />錛?錛夊嚱鏁幫紝寮曠敤銆侀噸杞姐侀粯璁ゅ弬鏁?br />錛?0錛夋洿澶氱殑鏁版嵁綾誨瀷錛岀粨鏋勫拰鑱斿悎錛堢被浼糲錛?br />--------------------
錛?1錛夌被
聽聽聽i錛夋瀯閫犲嚱鏁板拰鏋愭瀯鍑芥暟
聽聽聽ii錛夎闂檺瀹氱
聽聽聽iii錛夊弸鍛樺嚱鏁?br />聽聽聽iiii錛夎繍綆楃閲嶈澆
聽聽聽iiiii錛夌戶鎵褲佸皝瑁呫佸鎬?br />錛?2錛夋ā鏉?br />錛?3錛塩++鐨処O緋葷粺
錛?4錛夊悕瀛楃┖闂?br />錛?5錛夋爣鍑嗘ā鏉垮簱
錛?6錛塩++棰勫鐞嗗櫒
real ii_s[2,4]={1,1,1,1,2,2,2,2}
string s_s[2,3,4]
dec{2} fj
dec jj,ii
double d
/*
榪欓噷涓哄琛屾敞閲?br />fdsfsdfds
*/
time mytime
date mydate=2006-07-07
datetime mydatetime
char c='w'
string hello="it~'s a dog"http://it's a dog
any my,you,he
blob bk
boolean b
long l
int iss
ResultSet rs
resultsets rss //涓嶅尯鍒嗗ぇ灝忓啓
//榪愮畻絎?br />/*
1銆佺畻鏈繍綆楃:*銆?銆?銆?銆乛
2銆侀昏緫榪愮畻絎?NOT銆丄ND銆丱R
3銆佸叧緋昏繍綆楃:=銆?gt;=銆?gt;銆?lt;銆?lt;=銆?lt;>
4銆佽繛鎺ヨ繍綆楃:&
*/
jj+=jj+ii
jj=jj/ii
jj=jj*ii
jj -=ii
jj +=ii
//紼嬪簭鎺у埗璇彞錛氶夋嫨銆佸驚鐜佸叾浠栬鍙?br />if jj>ii then
聽//todo......
end if聽
if jj>ii then
聽//todo...
elseif jj=ii then
聽//todo...
end if
string sss_s
sss_s = create using "string"
transaction DBTrans
DBTrans=create transaction
DBTrans.autocommit=false
DESTROY DBTrans//閿姣乧reate鍒涘緩鐨勫璞★紝open鍒涘緩鍙鍖栧璞?/font>
CHOOSE CASE jj
聽CASE 1
聽聽//TODO...
聽CASE 2
聽聽//TODO...
聽CASE ELSE
聽聽//TODO...
END CHOOSE
/*(寰幆鍒ゆ柇)
.... DO UNTIL condition 鈥OOP
.... DO WHILE condition 鈥?LOOP
.... DO 鈥?LOOP UNTIL condition
.... DO 鈥?LOOP WHILE condition
FOR varname = start TO end [STEP increment]
statementblock
NEXT
*/
SQLCA.dbms="localhost"
//SQLCode=0鎴愬姛錛孲QLCode錛?1澶辮觸錛孲QLCode=100SQL璇彞娌℃湁榪斿洖鏁版嵁
CONNECT USING SQLCA;
DECLARE EMP_cur CURSOR FOR
select employee.fname
from employee
where employee.job_id =:i;
OPEN EMP_cur;
FETCH EMP_cur INTO :sss_s;
CLOSE EMP_cur;
select employee.fname into :sss_s //宓屽叆sql緙栫▼錛宲b鐨勭壒鑹?br />from employee
where employee.job_id =:i
using DBTrans;
if DBTrans.sqlcode=0 then
聽//todo...
聽COMMIT USING DBTrans;//浜嬪姟鎻愪氦
else
聽//toto...
聽ROLLBACK USING DBTrans;//浜嬪姟鍥炴粴
end if
DISCONNECT USING SQLCA;
(1)銆丠ALT銆丠ALT(CLOSE)
(2)銆丷ETURN
(3)銆丆REATE
(4)銆丏ESTROY
璇彞涓嶄互鍒嗗彿緇撴潫