Are you sure that this is determined by a single digit? Is "9" 2009? Can't it be 1999? What about "2"? Is it 1992? 2002? 2012?
I used these as an example, the full list is below:
Ah, OK, that makes more sense. So it's not a digit, but a character.
In that case you can use a series of if-else commands, or a switch command.
The former would look something like this:
var v = this.getField("Vin-10").valueAsString;
if (v=="P") event.value = "1993";
else if (v=="R") event.value = "1994";
else if (v=="S") event.value = "1995"; //etc.
else event.value = "";
Adjust the name of the field in the first row, and place the code as the custom calculation script of the Year field.
Getting the year of production for an automobile might be a little more complex then looking at the 10 position. Since the coding for a single digit omitting the possible confusing letters or I, O, Q, and Z only allows a span of 29 years or 1980 through 2009. The 10 digit does repeat for the next 29 years using the same single digit code so A could be 1980 or 2010. One needs to the 7th character for vehicles with GWR 0f 10,000 or less.
That's perfect. Exactly the direction I needed. Thanks!