⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 token.src

📁 没有说明
💻 SRC
字号:
/*
** token.src - String parser for KEYWORDS.
** (C) Copyright 1990-1998 by Aptech Systems, Inc.
** All Rights Reserved.
**
** This Software Product is PROPRIETARY SOURCE CODE OF APTECH
** SYSTEMS, INC.    This File Header must accompany all files using
** any portion, in whole or in part, of this Source Code.   In
** addition, the right to create such files is strictly limited by
** Section 2.A. of the GAUSS Applications License Agreement
** accompanying this Software Product.
**
** If you wish to distribute any portion of the proprietary Source
** Code, in whole or in part, you must first obtain written
** permission from Aptech Systems.
**
**> token
**
**  Purpose:    To extract the first token from a string.
**
**  Format:     { token,str_left } = token(str);
**
**  Input:      str         string, the string to parse.
**
**  Output:     token       string, the first token in str.
**
**              str_left    string, the remainder of the input string.
**
**  Remarks:    The input string can be delimited with commas or spaces.
*/

proc (2) = token(str);
    local i,n,cmdvec,tok;
    if strlen(str) == 0;
        retp("","");
    endif;
    cmdvec = vals(str);
    cmdvec = miss(cmdvec,13);
    cmdvec = miss(cmdvec,10);
    cmdvec = missrv(cmdvec,32);
    n = rows(cmdvec);
    i = 1;
    do while i <= rows(cmdvec);
        if cmdvec[i] /= 32 and cmdvec[i] /= 44;
            break;
        endif;
        i = i+1;
    endo;
    if i > rows(cmdvec);
        retp("","");
    endif;
    tok = cmdvec[i];
    i = i+1;
    do while i <= rows(cmdvec);
        if cmdvec[i] == 32 or cmdvec[i] == 44;
            do while i <= rows(cmdvec);
                if cmdvec[i] /= 32;
                    break;
                endif;
                i = i+1;
            endo;
            if i > n;
                break;
            endif;
            if cmdvec[i] == 44;
                i = i+1;
            endif;
            do while i <= rows(cmdvec);
                if cmdvec[i] /= 44 and cmdvec[i] /= 32;
                    break;
                endif;
                i = i+1;
            endo;
            break;
        endif;
        tok = tok|cmdvec[i];
        i = i+1;
    endo;
    if i <= rows(cmdvec);
        cmdvec = chrs(cmdvec[i:rows(cmdvec)]);
    else;
        cmdvec = "";
    endif;
    retp(chrs(tok),cmdvec);
endp;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -