Dr
Sat Sep 16 16:27:30 CDT 2006
JRS: In article <eDTH3$X2GHA.1292@TK2MSFTNGP03.phx.gbl>, dated Sat, 16
Sep 2006 07:05:04 remote, seen in news:microsoft.public.scripting.vbscri
pt, Walter Zackery <please_respond_to@group.com> posted :
>
>"Dr John Stockton" <jrs@merlyn.demon.co.uk> wrote in message
>news:fJwreWEgqxCFFwsp@merlyn.demon.co.uk...
>: JRS: In article <el0d8MK2GHA.328@TK2MSFTNGP06.phx.gbl>, dated Fri, 15
>: Sep 2006 04:45:01 remote, seen in news:microsoft.public.scripting.vbscri
>: pt, Walter Zackery <please_respond_to@group.com> posted :
>: >"Dr John Stockton" <jrs@merlyn.demon.co.uk> wrote in message
>: >news:UwB5ACDlUZCFFwvX@merlyn.demon.co.uk...
>: >: JRS: In article <Ob7A7e11GHA.2176@TK2MSFTNGP04.phx.gbl>, dated Wed, 13
>: >: Sep 2006 13:12:05 remote, seen in
>news:microsoft.public.scripting.vbscri
>: >: pt, Walter Zackery <please_respond_to@group.com> posted :
>: >:
>: >: > Length = 31 - Day(DateSerial(YearValue,MonthValue,31))
>: >: > If Length = 0 Then Length = 31
>: >:
>: >: Length = Day(DateSerial(YearValue, MonthValue+1, 0)
>:
>: Oops, another ) was needed.
>:
>: >: is simpler.
>: >:
>: >: ISTM that "Length" will not work if tested in a Web page; Leng?
>: >:
>: >Length will work as fine as a variable name under IE.
>:
>: For me, it did not. IE4, as per sig.
>:
>
>You say it doesn't work, but you can't explain why it doesn't work.
>Hmm......
I don't know in detail why. Using the following test HTML file,
I get a window saying
Internet Explorer Script Error
! An error has occurred in the script on this page.
Line: 2
Char: 1
Error: Object doesn't support this action: 'Length'
Code: 0
Do you want to ...
File : <script type="text/vbscript">
Length = 3
</script>
But if I remove a character from 'Length' then I get no error message.
Presumably 'Length' is an existing read-only Object. Its value appears
to be 0.
If one avoids using the sort of identifier spelling that might well be
already in use, one avoids such problems.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:
http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:
http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.