labs.insert-title.com

Converting ISBN-10 to ISBN-13


function isbn10toisbn13(isbn10)
	dim isbnARR(9)
		for i = 0 to 9
			isbnARR(i) = cint(mid(isbn10,i+1,1))
		next

	a = 9
	b = 7
	c = 8
	d = isbnARR(0)
	e = isbnARR(1)
	f = isbnARR(2)
	g = isbnARR(3)
	h = isbnARR(4)
	i = isbnARR(5)
	j = isbnARR(6)
	k = isbnARR(7)
	l = isbnARR(8)
	m = isbnARR(9)
	
	
	n = (a*1)+(b*3)+(c*1)+(d*3)+(e*1)+(f*3)+(g*1)+(h*3)+(i*1)+(j*3)+(k*1)+(l*3)
	o = 10-(n mod 10)
	isbn10toisbn13 = cstr("978" & left(isbn10,9) & o)
end function
Comments temporarily disabled for now, you can find me @joemaddalone