Tuesday, May 24, 2011

How to use SUBSTR() function...

static void Segregation(Args _args)
{
    str s,s1;
    int len,j,k;
    ;
    s = "Hello" +  '\n'+ date2str(today() ,123, 2, 2, 2, 2, 4) +" "+ time2str(timenow(),1,1) +":"+ curuserid();
    print s;
    len = strlen(s);
    j = strScan (s,":",len,-len);
    for(k = len; k >= 1 ; k--)
    {
        if(j == k)
        {
            break;
        }
        s1 = substr(s,k,k);
        len--;
    }
    print s1;
    pause;
}

No comments:

Post a Comment