www.pudn.com > cwin.rar > GETXYB.C


    /*----------------------------------------------------------- 
        函数 getxyb : 编辑逻辑型数据 
    -----------------------------------------------------------*/ 
    #include  
    #include  
 
    unsigned _Cdecl getxyb(col,line,value) 
    int col;             /* 编辑窗口左上角列坐标(以字节为单位) */ 
    int line;            /* 编辑窗口左上角行坐标(以象素为单位) */ 
    int *value;          /* 指向待编辑的逻辑数据的指针         */ 
    { 
        char buff[2]; 
        unsigned h; 
 
        /*-- 构造编辑缓冲区 -------------------*/ 
        buff[0] = *value?'Y':'N'; 
        buff[1] = 0; 
 
        /*-- 对非法输入值循环 -----------------*/ 
        while(1) 
        { 
            h = getxya(col,line,1,buff,"A"); 
            if(h==KEY_ESC || strchr("YTNFytnf",buff[0])) 
                break; 
            else 
            { 
                sound(900); 
                delay(100); 
                nosound(); 
            } 
        } 
 
        /*-- 构造输出结果 ---------------------*/ 
        if(h!=KEY_ESC) 
            *value=(strchr("YTyt",buff[0])==NULL)?0:1; 
 
        /*-- 返回退出编辑状态的键盘码 ---------*/ 
        return h; 
    }