/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Ubound på et array der ligger på _Applicat~
Fra : Søren \"Pengman\" Pe~


Dato : 25-01-04 14:01

Vær hilset

Jeg sidder og arbejder med at bygge en chat i ren asp og har problemer med
at få vist hvem der er online. Jeg har (tror jeg) opbygget den nødvendige
kode i min global.asa (som ses nedenfor), men på den side der skal uskrive
brugernavnene (chatters.asp) men alligevel får jeg denne fejl:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'ubound'

/chat/chatters.asp, line 9



Jeg har en anelse om at jeg ikke korrekt får initialiseret arrayet på
application, eller at jeg ikke får henvist korrekt til arrayet fra linie 9 i
chatters.asp



Jeg håber I kan hjælpe

Søren



--------------------------------------
chatters.asp-----------------------------

<html>
<head>
<title></title>
</head>

<body>
<%

for i = 0 to ubound(application("chatters"))
Response.Write(Application("chatters")(i) + "<br>")
next


%>

</body> </html>
----------------------------------------------------------------------------
-----

-------------------------------global.asa-----------------------------------
-----

<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Sub Application_OnStart
Application("currentchatters")=0
dim Application("chatters")
Application("txt1")=""
Application("txt2")=""
Application("txt3")=""
Application("txt4")=""
Application("txt5")=""
Application("txt6")=""
Application("txt7")=""
Application("txt8")=""
Application("txt9")=""
Application("txt10")=""
End Sub

Sub Application_OnEnd
' Commands to be run at shutdown
End Sub

Sub Session_OnStart

Application("currentchatters") = Application("currentchatters")+1
Redim Preserve (Application("chatters"))(currentchatters)
chatters(ubound(chatters))=session("nick")
session("index")=ubound(Application("chatters"))

End Sub

Sub Session_OnEnd

for i = (session("index") + 1) to ubound(Application("chatters"))
(Application("chatters"))(i-1) = (Application("chatters"))(i)
next

Application("currentchatters") = Application("currentchatters") -1
Redim Preserve (Application("chatters"))(currentchatters)

End Sub

</SCRIPT>

----------------------------------------------------------------------------
---



 
 
Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408527
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste