/
Forside
/
Teknologi
/
Udvikling
/
ASP
/
Nyhedsindlæg
Login
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Stil et spørgsmål
Skriv et tip
Pointsystemet
Kontakt Kandu.dk
Emnevisning
Kategorier
Alfabetisk
Karriere
Interesser
Teknologi
Reklame
Top 10 brugere
ASP
#
Navn
Point
1
smorch
9259
2
Harlekin
1866
3
molokyle
1040
4
Steffanst..
758
5
gibson
560
6
cumano
530
7
MouseKeep..
480
8
Random
410
9
strarup
370
10
Dysmorf
370
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
Alle emner
Teknologi
Udvikling
ASP
Indstillinger
Spørgsmål
Tips
Usenet
Reklame
Statistik
Spørgsmål :
177818
Tips :
31980
Nyheder :
719565
Indlæg :
6410969
Brugere :
218912
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2026 kandu.dk. Alle rettigheder forbeholdes.