Bootcamp: Chapter 15 - Code Snippets

Step 465

--  ABC123 
let sing=SysSingleton.oclSingleton in (
  let letter1=sing.RegNumberLetter1Current+1 in
  (
    sing.RegNumberLetter1Current:=(letter1>Char.ConvertToUtf32('Z',0))->casetruefalse(sing.RegNumberLetter2Current:=sing.RegNumberLetter2Current+1; Char.ConvertToUtf32('A',0),letter1)
  );
  let letter2=sing.RegNumberLetter2Current in
  (
    sing.RegNumberLetter2Current:=(letter2>Char.ConvertToUtf32('Z',0))->casetruefalse(sing.RegNumberLetter3Current:=sing.RegNumberLetter3Current+1; Char.ConvertToUtf32('A',0),letter2)
  );
  let letter3=sing.RegNumberLetter3Current in
  (
    sing.RegNumberLetter3Current:=(letter3>Char.ConvertToUtf32('Z',0))->casetruefalse(Char.ConvertToUtf32('A',0),letter3)
  );
  let numberpart=sing.RegNumberNumberPartCurrent+1 in
  (
    sing.RegNumberNumberPartCurrent:=(numberpart>999)->casetruefalse(0,numberpart)
  );
Char.ConvertFromUtf32(sing.RegNumberLetter1Current)+Char.ConvertFromUtf32(sing.RegNumberLetter2Current)+Char.ConvertFromUtf32(sing.RegNumberLetter3Current)+sing.RegNumberNumberPartCurrent.ToString('000')

)
This page was edited 13 days ago on 11/01/2024. What links here