在VFP6.0中为何类似if substr(fxdate,5,1) = '-'的条件总不成立?
在VFP6.0中为何类似if substr(fxdate,5,1) = '-'的条件总不成立?
具体如下:
if substr(fxdate,5,1) = '-'
replace month3 with substr(fxdate,4,1) all
replace day3 with substr(fxdate,6,2) all
else
replace month3 with substr(fxdate,4,2) all
replace day3 with substr(fxdate,7,2) all
endif
其中fxdate字段的值为05-3-8,字段类型为char,但是if substr(fxdate,5,1) = '-'条件总为假
好困惑。。。(个人经验:凡是涉及判断字符相等的时候总为假)
明明执行?substr(fxdate,5,1)时得到的字符就是'-'啊!!!
请教各位大侠,谢谢!