Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBScript Function Name Maximum Length

I'm wondering what the maximum allowed length of a function name in Classic ASP (VBScript) is.

like image 542
Preston Avatar asked Feb 25 '23 04:02

Preston


2 Answers

The following fails with identifier too long @ 256 characters

for i = 1 to 1024
    execute "function " & string (i, "X") & ": end function"
    WScript.echo i
next
like image 64
Alex K. Avatar answered Feb 27 '23 20:02

Alex K.


I think it is 255, but you should not abuse it :)

From the MSDN reference for Function:

name
Name of the Function; follows standard variable naming conventions.

And from the MSDN reference for Variables:

[...] A variable name:

  • Must begin with an alphabetic character.
  • Cannot contain an embedded period.
  • Must not exceed 255 characters.
  • Must be unique in the scope in which it is declared.
like image 32
Sebastian Castaldi Avatar answered Feb 27 '23 19:02

Sebastian Castaldi