hello all!
ok, I've GOT to be missing something.. I have some code here (see below) that supposed to do 1 of 3 things..
1) CHeck the lenght of input to a SSN file..
if it's less then 9.. then go on..
2) IF it's blank or equals zero then create a random
9 digit number
3) if non of the above give an error code...
I think the logic is good... but VFP can't seem to figure this on out.. am I doing something wrong?!
thank you in advance....
The PogoWolf
IF LEN(alltrim(thisform.SSN.value)) < 9 THEN
IF ISBLANK(alltrim(thisform.SSN.value)) OR alltrim(thisform.SSN.value) = "0" THEN
x = 10000000001
DO WHILE x > 999999999
x = INT((999999999-1+1)*RAND()+1)*SECONDS()
ENDDO
IF LEN(STR(x)) < 9 then
FOR y = 0 to 9 - LEN(STR(x))
ToAdd = ToAdd + "0"
ENDFOR
thisform.SSN.value = ToAdd + upper(STR(x))
ELSE
thisform.SSN.value = upper(STR(x))
ENDIF
ELSE
&& ok, it's not Blank and doesn't = 0 then it's an Error
IF iOk <> 0 AND iOk < 9 then
ELSE
iOk = 9 &&Error Code
ENDIF
ENDIF
ENDIF ******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf
ok, I've GOT to be missing something.. I have some code here (see below) that supposed to do 1 of 3 things..
1) CHeck the lenght of input to a SSN file..
if it's less then 9.. then go on..
2) IF it's blank or equals zero then create a random
9 digit number
3) if non of the above give an error code...
I think the logic is good... but VFP can't seem to figure this on out.. am I doing something wrong?!
thank you in advance....
The PogoWolf
IF LEN(alltrim(thisform.SSN.value)) < 9 THEN
IF ISBLANK(alltrim(thisform.SSN.value)) OR alltrim(thisform.SSN.value) = "0" THEN
x = 10000000001
DO WHILE x > 999999999
x = INT((999999999-1+1)*RAND()+1)*SECONDS()
ENDDO
IF LEN(STR(x)) < 9 then
FOR y = 0 to 9 - LEN(STR(x))
ToAdd = ToAdd + "0"
ENDFOR
thisform.SSN.value = ToAdd + upper(STR(x))
ELSE
thisform.SSN.value = upper(STR(x))
ENDIF
ELSE
&& ok, it's not Blank and doesn't = 0 then it's an Error
IF iOk <> 0 AND iOk < 9 then
ELSE
iOk = 9 &&Error Code
ENDIF
ENDIF
ENDIF ******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf