作者guessi.bbs@cpu.tfcis.org (沒) 看板: itoc
標題[修正] 註冊單欄位檢查
時間動力核心 (2007/03/24 Sat 03:38:42)
> (R)egister 《 填註冊單 》
輸入不可為空白、生日輸入限制於範圍內
:src/maple/user.c:getfield()
static void
getfield(line, len, buf, desc, hint)
int line, len;
char *hint, *desc, *buf;
{
+ int rc = 0;
move(line, 0);
prints("%s%s", desc, hint);
+ while(!rc)
+ rc = vget(line + 1, 0, desc, buf, len, GCARRY) ? 1 : 0;
- vget(line + 1, 0, desc, buf, len, GCARRY);
}
:src/maple/user.c:u_register()
+ if (atoi(rform.month) < 1 || atoi(rform.month) > 12 ||
+ atoi(rform.day) < 1 || atoi(rform.day) > 31 ||
+ atoi(rform.year) < 1 || atoi(rform.year) > 99)
+ /* 民國99年出生 ...還不會上網呢 */
+ {
+ vmsg("生日資料有誤,請修正!");
+ ans = 'n';
+ }
+ else
ans = vans("請確認以上資料是否正確(Y/N/Q)?[N] ");
--
=[﹎:�摃�◣��:﹎ Origin ]|[ ���O���� cpu.tfcis.org ]|[�搟說�﹎:]=
=[﹊:�摃�╱��:﹊ Author ]|[59-115-96-247.dynamic.hine]|[���插�﹊:]=