zoukankan      html  css  js  c++  java
  • Process Multiple Items respectively by commas!

    Sometimes,User hope you can help to resolve som problem(such as relrease Items on Item detail) ,So they are provide some of Items number list to you and  respectively by commas! you can using below Jobs process Multiple Items respectively by commas!

    Wrote by Jimmy on April 21th 2011

    01)static method in class(global or Customize class)

    Static method of setMulitItems
    static Set setMulitItems(LogText _str ,
    str
    10 _flag = ',')
    {
    int CountLine,long;
    LogText Sid,nextSid,longIdx;
    str DataIdx;
    set set = new set(types::String);
    ;
    Sid
    = strlrtrim(_str);
    Sid
    = strRem(Sid,"\n");
    Sid
    = strRem(Sid,"\r");
    longIdx
    = Sid;

    while(StrFind(Sid, _flag, 1, 30) != 0)
    {
    long = strFind(Sid, _flag, 1, 30);
    DataIdx
    = substr(Sid, 1, long - 1);
    set.add(DataIdx);

    nextSid
    = substr(Sid, long + 1, strlen(longIdx) - long);
    Sid
    = strlrtrim(nextSid);
    long = 0;
    }
    set.add(Sid);
    return set;
    }
    Static Method of ListMulitItems
    static List ListMulitItems( LogText _str ,
    str
    10 _flag = ',')
    {
    int CountLine,long;
    LogText Sid,nextSid,longIdx;
    str DataIdx;
    List list
    = new List(Types::String);
    ;
    list
    = new list(types::String);

    Sid
    = strLRtrim(_str);
    Sid
    = strRem(Sid,"\n");
    Sid
    = strRem(Sid,"\r");
    longIdx
    = Sid;

    while(StrFind(Sid, _flag, 1, 30) != 0)
    {
    long = strFind(Sid, _flag, 1, 30);
    DataIdx
    = substr(Sid, 1, long - 1);
    list.addEnd(DataIdx);

    nextSid
    = substr(Sid, long + 1, strlen(longIdx) - long);
    Sid
    = strLRtrim(nextSid);
    long = 0;
    }
    list.addEnd(Sid) ;
    return list;
    }

    02)Jobs

    Jobs of Jimmy_MultiItemsSet
    static void Jimmy_MultiItemsSet(Args _args)
    {
    /** Wrote by Jimmy on April 21th 2011
    List : No Automatic sorting
    Set : Automatic sorting by ascending
    */
    dialog dlg
    = new dialog("Check Item Locked");
    Set
    set = new Set(types::String);
    DialogField dlgStr
    = dlg.addField(types::String,"Use respectively by commas");
    str LongStr;
    SetEnumerator se;
    int i;
    ;
    dlgStr.displayHeight(
    20);
    dlgStr.displayLength(
    50);
    dlg.doInit();
    if(!dlg.run())
    return ;
    setPrefix(Curext());
    LongStr
    = strlrtrim(dlgStr.value());
    LongStr
    = global::strReplace(LongStr,"\n","");
    LongStr
    = strRem(LongStr,"\n");


    IF(
    !LongStr)
    throw error("Please Enter ItemId");

    set = QVS_ProcessLongStr::setMulitItems(LongStr);
    se
    = set.getEnumerator();

    setprefix(
    "Such as List... ...");
    while(se.moveNext())
    {
    info(Strfmt(
    "%1",se.current()));
    i
    ++;
    }

    info(strfmt(
    'Total have %1 Items',i));

    }
  • 相关阅读:
    为 IBM Lotus Notes V8 构建复合应用程序(三)
    为 IBM Lotus Notes V8 构建复合应用程序(一)
    Lotus Notes 8中全新的Out of Office功能
    为 IBM Lotus Notes V8 构建复合应用程序(四)
    为 IBM Lotus Notes V8 构建复合应用程序(六)
    为 IBM Lotus Notes V8 构建复合应用程序(五)
    为 IBM Lotus Notes V8 构建复合应用程序(七)
    为 IBM Lotus Notes V8 构建复合应用程序(二)
    为 IBM Lotus Notes V8 构建复合应用程序(十)
    opencore内部调度
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2023677.html
Copyright © 2011-2022 走看看