Hi Folks,
I need some help and a lot more knowlege. One will come eventually and maybe
you can provide the other.
Fairly well versed in ASP-VBScript, but new to using the Global.asa. Can I
define an Array in my Global.asa and make it available to my application?
Here's the deal. Each asp page needs access to an array of names to read
from, numbering between 10 and 19 per page. I have an Application(Pointer)
that is incremented per the number of names read from the array so the next
page starts where the last left off. At present there are 129 names in the
array. More to come. The Application(Pointer) is working and is incremented
properly in a test page. The Global.asa generates no errors. However any
attempt to access the Array() gives me an error.
.................................................. ................
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'AlphaArray'
/rev/work/metatest.asp, line 26
Can it be the "/rev/work/" causing this?
.........................................
Here is my Global.asa
//////////////////////
<script language="vbscript" runat="server">
sub Application_OnStart
DIM pointer, AlphaArray()
Application(pointer)=1
filename=Server.MapPath("../docs/Alpha.txt")
Set fs=CreateObject("Scripting.FileSystemObject")
Set aobj=fs.OpenTextFile(filename,1)
Do
a=aobj.readline
if a="#END" then exit Do
AlphaArray(i+1)=a
i=i+1
Loop
Application(AlphaArray())=AlphaArray()
AlphaArray=""
end sub
sub Application_OnEnd
Application(AlphaArray())="":Application(pointer)= ""
end sub
</script>
//////////////////////////
Here is the offending script in the test page
\\\\\\\\\\\\\\\\\\\\\\\\\\
<%
pointer=Application("pointer")
Response.Write(pointer)
If pointer > 129 then pointer=1
DIM wordval, term, Fetch, Hilimit
wordval=6
term=chr(34) & ">"
Fetch=20-wordval
Hilimit=pointer+Fetch
DO
Response.Write(Application(MetaArray(Pointer+1)) & term)
Pointer = Pointer+1
If Pointer=Hilimit then Exit DO
LOOP
%>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\