如何判断当前字符串是不是Table

static void TestTableName(Args _args)
{
    str tmpStr = "TableName";
    ;
    if (TableName2Id(tmpStr))
    {
        info("It is a table");
    }
    else
    {
        info("Sorry,it is not a table");
    }
}

 

//  another method

static server boolean checkTableName(str 50 _str)
{
    Dictionary dictionary ;
    int tableCnt ;
    int i ;
    TableId  tableId ;
    ;
    dictionary = new Dictionary() ;
    tableCnt = dictionary.tableCnt();
    for (i = 1 ; i <= tableCnt ; i++)
    {
        tableId = dictionary.tableCnt2Id(i) ;
        if ( _str == dictionary.tableName(tableId) )
        {
             return true ;
        }
    }
    return false ;
}

posted @ 2012-04-17 10:07  K小子  阅读(187)  评论(0)    收藏  举报