Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MOD()
Message
 
To
13/07/1999 11:56:23
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: MOD()
Miscellaneous
Thread ID:
00240784
Message ID:
00241281
Views:
12
You can read the other posts about mod() as a remainder, but assuming you need mod 7 as in "base 7" or like base 2 (binary) this should verify that a number does indeed fit the "base 7" form

function VerifyBase7(tcNumber)
return not('7' $ tcNumber or '8' $ tcNumber or '9' $ tcNumber)


>Does the way MOD() (or "mod 7") works is the digits must be 6 (via, 123456) or it must have a character and then 6 digits (via, A123456)? So, is the correct way to check/verfiy it is (this formula is for with a character and then 6 digits):
>
>STORE SUBSTR(num,2,5) TO no
>STORE MOD(VAL(no),7) TO chk
>IF SUBSTR(STR(chk),10,1) = SUBSTR((no,7,1)
>
>ELSE
>
>ENDIF
>
>Is that correct? I am puzzled with my supervisor saying it is the 4 digits, but the old program that I am looking uses 5 digits. I am all new to this. I never learned "mod 7" before.
>
>Chuck
If they have you asking the wrong questions,
they don't have to worry about the answers.
-proverbs for paranoids #3
Previous
Reply
Map
View

Click here to load this message in the networking platform