# ASCII function?

I'm trying to program a 5 letter character code (with the last letter in the code serving as a "check digit"). In order to calculte the check digit based on a character code, I need to use an ascii function. Is there code or syntax for obtaining the ASCII code of a character variable in ODK?

In microsoft excel the algorithm works in 5 calculations shown below to verify the entered check digit:

EXAMPLE:
Barcode entered: FUHFK
Entered check digit (last letter): K

1. RESULT1 =( (CODE(MID(FUHFK,1,1)) - 65)*1) + ((CODE(MID(FUHFK,2,1)) - 65)*3) + ((CODE(MID(FUHFK,3,1)) - 65)*5) + ((CODE(MID(FUHFK,4,1)) - 65) *7)

2. RESULT2 = FLOOR((RESULT1/26),1) + MOD(RESULT1,26)

3. RESULT3 =IF(RESULT2>25,INT((\$RESULT2/26)) + MOD(\$RESULT2,26),RESULT2)

4. RESULT4=ASC(65 + RESULT3)

5. Calculated check digit = =CHAR(RESULT4)

No. This is probably best handled by writing a program to process the
string and return whether or not it is good.
See the launching a 3rd party app section under:
http://opendatakit.org/help/form-design/examples/#integer_prompts
And see the feature that allows you to pass additional arguments to that
app here: http://opendatakit.org/help/form-design/external-apps/

ยทยทยท On Tue, Jul 1, 2014 at 7:13 AM, wrote:

I'm trying to program a 5 letter character code (with the last letter in
the code serving as a "check digit"). In order to calculte the check digit
based on a character code, I need to use an ascii function. Is there code
or syntax for obtaining the ASCII code of a character variable in ODK?

In microsoft excel the algorithm works in 5 calculations shown below to
verify the entered check digit:

EXAMPLE:
Barcode entered: FUHFK
Entered check digit (last letter): K

1. RESULT1 =( (CODE(MID(FUHFK,1,1)) - 65)*1) + ((CODE(MID(FUHFK,2,1)) -
65)*3) + ((CODE(MID(FUHFK,3,1)) - 65)*5) + ((CODE(MID(FUHFK,4,1)) - 65) *7)

2. RESULT2 = FLOOR((RESULT1/26),1) + MOD(RESULT1,26)

3. RESULT3 =IF(RESULT2>25,INT((\$RESULT2/26)) + MOD(\$RESULT2,26),RESULT2)

4. RESULT4=ASC(65 + RESULT3)

5. Calculated check digit = =CHAR(RESULT4)

## --

You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an