Axapta 全局函数

当前公司ID
ComName=appl.company().ext();              // 当前公司 ID
当前用户ID
       curUserid();                                                     // 当前用户 ID
当前时间
       systemDateget();                                           // 当前时间
         TimeNow()
       Time2Str(timenow(),1,2);                             // 时间转换函数
当前用户
       curuserid()                                                       // 当前用户
 
大小写金额转换
aa=ATL_NumConvertByLanguage::Num2StrByLanguage(380000.55);
         beep(); 
     Sleep(10); //Sleep
 
文件操作
fileExists(_name)    若存在文件,则返回 true
        folderExists(_name) 
若存在文件夹或文件,则返回 true
        pathExists(_name)   
若存在文件夹,则返回 true
 
日期操作
取系统当前时间                       systemDateget();                                                    //
本机时间                                         Today()
日期转字符窜                      date2str(datefrom.dateValue(),3,2,3,2,3,4) //2007-01-01
字符窜转换为日期            str2date(“2007-01-01" ,321)                     //2007-01-01
Any2Date                             any2date('2105-12-28')                                       //2105-12-28
 
DateStart.dateValue(Global::dateStartMth(Global::dateStartMth(systemDateGet()) - 1)) ;
DateEnd.dateValue(Global::dateStartMth(systemDateGet()) - 1) ;
 
--- Date Operation ---
mkdate(26,9,2006) ;            //create date
mthname(6) ;                //to mouth name
DayOfMth(26/02/1998);       //get Day
MthOfYr(15/2/1998) ;         //get mouth
Year(26/09/2006);                    //get year
 
NextQtr(26/9/1998);            //get next following quarter
PrevQtr(26/9/1998);
 
NextYr(26/09/2006);            //get next year
PrevYr(26/09/2006);            //get prev year
 
wkofyr(26/09/2006)              //get WK
        
         Num2Str(12345.6,10,2,2,1) ;
     Num2Str(12345.6,1,0,1,0)   ;
 
static void Job85(Args _args)
{
    //beep();
    int i;
    Str mytxt = "first-line/nsecond-line/nlast-line";
    ;
 
    print any2date('05-05-05');
/*    //beep pc sound control
    for (i=0;i<3;i++){
        beep();
        Sleep(500); //Sleep
    }
*/
 /*
    print classstr(ABCBase);//
    print classNum(ABCBase);//
 
    print maxdate();
 
    print maxint();
    print minint();
*/
 
/*
    print "--- Date Operation ---" ;
    print mkdate(26,9,2006) ;   //create date
    print mthname(6) ;          //to mouth name
    print DayOfMth(26/02/1998); //get Day
    print MthOfYr(15/2/1998) ; //get mouth
    print Year(26/09/2006);     //get year
   
    print "***Num2Date(366)";
    print Num2Date(365) ;       //Num to Date
 
    print "----Next Prev Mth 2006-09-30----" ;
    print NextMth(30/9/2006); //get next date
    print PrevMth(30/9/2006);
 
    print "----Next Prev Qtr 1980-09-26 ----";
    print NextQtr(26/9/1998); //get next following quarter
    print PrevQtr(26/9/1998);
 
    print "---Next Prev Yr 2006-09-26----" ;
    print NextYr(26/09/2006); //get next year
    print PrevYr(26/09/2006); //get prev year
 
    Print "---Today---";
    print Today() ;
    print systemdateget(); //?
 
    print "---- End Mouth Date 2006-09-26----" ;
    print EndMth(26/09/2006);
 
    print "--- Next Date 2006-09-26---";
    print ((26/09/2006) + 1);
 
    print "------work num---------" ;
    print wkofyr(26/09/2006);
 
*/
/*
    //char operation
    print "--- num to char 65--A ---";
    print num2char(65);
    print char2num('A',1);
*/
/*
    //num operation
    print "---num to string--- 12345.6";
    print Num2Str(12345.6,10,2,2,1) ;
    print Num2Str(12345.6,1,0,1,0)   ;
 
 
    print "--- power ---";
    print Power(2,3); // 次方操作
 
    print "--- PrimoYr(date arg) ---";
    print PrimoYr(mkdate(26,9,200));   //??
*/
/*
    print "--- QueryStr ---";
    print Rate(10000,1000,20);
 
    print "--- Round ---";
    print "Round(123.45,5.00)";
    print Round(123.45,5.00);
    print "Round(7.45,1.05)";
    print Round(7.45,1.05) ;
*/
/*
    print "--- string compare ---";
    print strCmp("abc","abc1");
    print StrDel("123456",2,2);
    print SubStr("123456",2,3);
    print StrIns("1456*****","23",2);
 
    print StrRem("ABCDEFGABCDEFG","ACEG") ; // returns the text string "BDFBDF".
    print StrKeep("ABBCDDEFGHB","BCD");     // returns the text string "BBCDDB".
    print StrLTrim(" 213123 1232321 ");
    print StrRTrim(" 213123 1232321 ");
    print StrFind("ABCDEFGHIJ","KHD",1,10); //returns the value '4' (the position where "D" was found).
    print StrFind("ABCDEFGHIJ","KHD",10,-10);//returns the value '8' (the position where "H" was found).
 
    print StrNFind("ABCDEFGHIJ","ABCDHIJ",1,10);//returns the value '5' (the position of "E").
    print StrNFind("CDEFGHIJ","CDEFGIJ",10,-10); //returns the value '6' (the position of "H").
 
    print StrScan("ABCDEFGHIJ","DEF1",1,10) ; //returns the value '4' (the position of text string "DEF").
    print StrScan("ABCDEFGHIJ","CDE2",10,-10); //returns the value '3' (the position of text string "CDE").
 
    print StrFmt("This is a test!+ %1 + %2 +%3","error","!","... ...") ;
    print StrLen("123456");
 
    //Str mytxt = "first-line/nsecond-line/nlast-line";
    Print mytxt ;
    Print strline(mytxt,1); // will print "second-line;
    Print strline(mytxt,2); // will print "last line";
 
    print "StrLwr(AbCDefg)"+StrLwr("AbCDefg") ;
    print "StrUpr(AbCDefg)"+StrUpr("AbCDefg") ;
 
    print StrPoke("12345678","AAA",3);//StrPoke("12345678","AAA",3) returns the text string "12AAA678".
    print strprompt("abc",6);
 
    print StrRep("AB",3);
 
    print time2str( TimeNow(),4,1 ) ;
    print Time2Str(18098,1,1); //returns the text string "05:01:38".
    print Time2Str(18098,1,2); //returns the text string "05:01:38 am".
 
    print Time2Str(18099,0,0) ;//returns the text string "05 01 39".
    print Time2Str(18099,0,0); //returns the text string "05 01 39 am".
 
    print Systemdateget(); //Current system date
    print Today();          //Current pc date
    //print Timeget();
    Print TimeNow();
*/
 
    pause;
}
 

你可能感兴趣的:(Axapta,开发技术)