ASCII problem
ASCII problem
- Subject: ASCII problem
- From: Jacco Rens <email@hidden>
- Date: Wed, 25 Apr 2001 23:24:27 +0200
Hi all,
i have a small problem here, where i can't find the answer on. The
script might speak for itself;
set temp to "19110027900059" as string
set temp2 to {}
display dialog temp
repeat with i from 1 to ((length of SCCF) div 2)
set chunk to {}
set chunk to characters 1 thru 2 of temp as text
if chunk < 90 then
set temp2 to temp2 & (chunk + 33)
display dialog temp2 -- not finsished here:-)
else
set temp2 to temp2 & (chunk + 71)
display dialog temp2 -- not finsished here:-)
end if
-- here's the problem
-- every calculation of temp2 needs to become an ascii character in
a list and
-- remove item 1 & 2 from temp, so 19110027900059 becomes 110027900059
end repeat
the outcome needs to be; 4,!<0!\ (these are the ascii characters,
instead of their numbers)
This is an script wich will generate an checksum, i'm not sure if it
will work, but i'm close :-)
hereby also it's Visual basic original:
SCCF = 19110027900059
temp = SCCF
for i = 1 To Len(SCCF) / 2
chunk = left(temp, 2)
if val (chunk) < 90 then
temp2 = temp2 + chr(val(chunk) + 33)
else
temp2 = temp2 + chr(val(chunk) + 71)
end if
temp = right(temp, len(temp) - 2)
next i
hereby variable temp2 gets converted to ascii with an special program
--
Experience is what you get when you didn't get what you wanted
best,
Jacco
Netherlands