String attributes in LO basic

The function below check the name of a given sheet. The function stops at the instruction if sheetName.Length = 5 and ... with the error: “Basic syntax error. Symbol sheetName already defined differently.”. Same error whatever name I give to this variable.

function isDaySheet(sheet)
   dim sheetName as String
   dim day as String
   dim month as String
   sheetName = sheet.name
   if sheetName.Length = 5 and sheetName(2) = "-" then
      day(0) = sheetName(0)
      day(1) = sheetName(1)
      month(0) = sheetName(3)
      month(1) = sheetName(4)
      if val(day) >= 1 and val(day) <= 31 and _
         val(month) >=1 and val(month) <= 12 then
         isDaySheet = True
      else
         isDaySheet = False
      end if
   else
      isDaySheet = False
   end if
end function

Is the attribute Length valid for a String?
What other mistake might I have done?

And what means sheet? ThisComponent.getSheets()? Use sheet.getCount()

Oh! sheet is single sheet? Ok, use Len(sheetName)

Thank you for your reply. I saw the syntax .Length in a code example but can’t retrieve it. I should have checked in Pitonyak’s book before posting, sorry for the bother.

assuming »sheetName« is a string … which flavour of Basic do you talk about :see_no_evil:

I am using LO basic (LO Version: 6.4.7.2 / linux).
I am totally new to basic :face_with_diagonal_mouth:. I had to replace sheetName(2) by mid(sheetName, 3, 1).
Thank you anyway for your reply.