Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
35
Task/SEDOLs/FutureBasic/sedols.basic
Normal file
35
Task/SEDOLs/FutureBasic/sedols.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
local fn Checksum( s as CFStringRef ) as CFStringRef
|
||||
CFStringRef v = @"0123456789-BCD-FGH-JKLMN-PQRST-VWXYZ", w = @"131739"
|
||||
long i, sum = 0
|
||||
for i = 0 to len(s) - 1
|
||||
CFRange r = fn StringRangeOfString( v, mid(s,i,1) )
|
||||
if ( r.location == NSNotFound ) then return NULL
|
||||
sum += r.location * intval(mid(w,i,1))
|
||||
next
|
||||
end fn = concat( s, @((10 - (sum % 10)) % 10) )
|
||||
|
||||
void local fn DoIt
|
||||
CFArrayRef sedols = @[
|
||||
@"710889",
|
||||
@"B0YBKJ",
|
||||
@"406566",
|
||||
@"B0YBLH",
|
||||
@"228276",
|
||||
@"B0YBKL",
|
||||
@"557910",
|
||||
@"B0YBKR",
|
||||
@"585284",
|
||||
@"B0YBKT",
|
||||
@"B00030",
|
||||
@"ABCDEF"]
|
||||
CFStringRef sedol
|
||||
for sedol in sedols
|
||||
CFStringRef s = fn Checksum( sedol )
|
||||
if ( s ) then print s : continue
|
||||
print @"Invalid"
|
||||
next
|
||||
end fn
|
||||
|
||||
fn DoIt
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue