PC Review


Reply
Thread Tools Rate Thread

ASP problem: is this a bug in VBScript?

 
 
Jеns Mаrtin Schlаttеr
Guest
Posts: n/a
 
      3rd May 2010
I'm running a web server with vbscript 5.8

I have the following problem: I define a class, put the instances into
an array, and write this array into the Session instance.
When getting back the array, there are still objects in it, but
VBScript seems to forget the type of object.
Is this a bug in the object serialisation?

The code is:

<%@ LANGUAGE="VBSCRIPT" %>
<% OPTION EXPLICIT
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
</head>
<body>
<%
class test
public txt
end class

dim t
t=array()
if isEmpty(Session("tst")) then
dim tObj:set tObj=new test
tObj.txt="1234"
redim preserve t(10)
set t(0)=tObj
Session("tst") = t
else
t = Session("tst")
response.write("from session<br>")
end if

response.write(" "&t(0).txt)

%>

</body>
</html>

You have to reload the page to see the problem.

Martin Schlatter


 
Reply With Quote
 
 
 
 
Nobody
Guest
Posts: n/a
 
      3rd May 2010
You need to ask your question in a group with "asp" in the name. VB.Net is
not compatible with VBScript, it uses the extension ASPX to differentiate
from classic ASP.

news://msnews.microsoft.com/microsof...er.asp.general
news://msnews.microsoft.com/microsof...pting.vbscript


 
Reply With Quote
 
Michel Posseth [MCP]
Guest
Posts: n/a
 
      3rd May 2010

"J?ns M?rtin Schl?tt?r" <(E-Mail Removed)> schreef in bericht
news:323bcc54-8def-4bec-bb12-(E-Mail Removed)...
> I'm running a web server with vbscript 5.8
>
> I have the following problem: I define a class, put the instances into
> an array, and write this array into the Session instance.
> When getting back the array, there are still objects in it, but
> VBScript seems to forget the type of object.
> Is this a bug in the object serialisation?
>
> The code is:
>
> <%@ LANGUAGE="VBSCRIPT" %>
> <% OPTION EXPLICIT
> %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
> <html>
> <head>
> </head>
> <body>
> <%
> class test
> public txt
> end class
>
> dim t
> t=array()
> if isEmpty(Session("tst")) then
> dim tObj:set tObj=new test
> tObj.txt="1234"
> redim preserve t(10)
> set t(0)=tObj
> Session("tst") = t
> else
> t = Session("tst")
> response.write("from session<br>")
> end if
>
> response.write(" "&t(0).txt)
>
> %>
>
> </body>
> </html>
>
> You have to reload the page to see the problem.
>
> Martin Schlatter
>


<%@ LANGUAGE="VBSCRIPT" %>
<% OPTION EXPLICIT
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
</head>
<body>
<%
class test
public txt
end class

dim t
t=array()
if isEmpty(Session("tst")) then
dim tObj:set tObj=new test
tObj.txt="1234"
redim preserve t(10)
set t(0)=tObj
Session("tst") = t
else
t = Session("tst")

response.write("from session<br>")
end if

Dim objP as test
Set objP=t(0)

response.write(" "& objP.txt)

%>

</body>
</html>


HTH

Michel

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set a reference to Microsoft VBScript Regular Expressions(vbscript.dll) cate Microsoft Excel Programming 3 1st Dec 2009 03:07 PM
VBScript problem Rosebud Microsoft Access VBA Modules 5 29th Jan 2008 03:45 AM
VBScript Problem =?Utf-8?B?SmFjayBMdW1pbm91cw==?= Windows XP Internet Explorer 2 23rd Mar 2006 04:46 PM
vbScript problem Ryan Windows XP Internet Explorer 0 28th Jul 2004 08:11 PM
VBScript Problem :-( PBeast Microsoft Outlook Form Programming 1 1st Sep 2003 03:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.