Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Expected end of statement error


Message #1 by bharath reddy <bharath_reddy@u...> on 17 Oct 00 03:49:44 MDT
i am declaring a class_initialize function.

end sub is associated with it.





----- Original Message ----- 



From: Peter Harper 



To: How To 



Sent: Sunday, October 15, 2000 6:44 PM

Subject: Re: Expected end of statement error





Your using an 'End Sub' statement without declaring a Sub function, ...no

t

sure of the syntax you need but I think thats your problem.

 



HTH

 



peter

----- Original Message ----- 



From: Arun 



To: How To 



Sent: Sunday, October 15, 2000 9:18 AM

Subject: Expected end of statement error





Hi pals,

   i am getting this error when i try to use classes in asp(2.0) on NT.



Microsoft VBScript compilation error '800a0401'

Expected end of statement

/template/cardef.asp, line 14

public property get color





my class file is=3D20



<%

class car

   private internal_color

   private internal_speed

   private internal_headlights

private sub class_initialize()

  internal_speed =3D0

  internal_color =3D"white"

  internal_headlights =3Dfalse

end sub

   public property get color  ////-- > This is line 14

   color =3Dinternal_color



    end property

   



   public property let color(byval strcolor)

    internal_color =3Ducase(strcolor)

    end property



   public property get Speed

    speed =3Dinternal_speed

    end property

   



   public property let speed(byval ispeed)

    internal_color =3Dispeed

    end property



   public Function functionchecklights

    if internal_headlights then  



      checkheadlights =3D"on"

    else

     checkheadlights =3D "off"

    end if

    end function

  end class

%>



and my asp page using this class is



<%@ Language=3DVBScript %>

<%option explicit%>

<HTML>

<HEAD>

<META NAME=3D"GENERATOR" Content=3D"Microsoft Visual Studio 6.0">

</HEAD>

<BODY>

<!--#include file =3D"cardef.asp"-->

<%

  dim obj1

  set obj1 new car

  Response.write("The car is " % obj1.color)

  Response.Write("<br>")

  Response.Write("the headlights are")

  Response.Write(obj1.checklights)

  Response.write("<br>")

 obj1.speed =3D 44

Response.Write("Car is running at a speed of ")

  Response.Write(obj1.speed)

  Response.Write("<br>")

  set obj1 =3Dnothing

%>



</BODY>

</HTML>



Thanks in advance for any help

Arun

TickleWit.com Pvt Ltd

0 98300 24824

91 33 3574692 







Message #2 by "Stephen Biggerstaff" <stephenb@w...> on Tue, 17 Oct 2000 11:14:11 +0100
Please see this thread on proasp_howto.  Approved here in error.



Moderator



"bharath reddy" <bharath_reddy@u...> wrote in message

news:16485@a..._databases...



i am declaring a class_initialize function.

end sub is associated with it.





----- Original Message -----

From: Peter Harper

To: How To

Sent: Sunday, October 15, 2000 6:44 PM

Subject: Re: Expected end of statement error





Your using an 'End Sub' statement without declaring a Sub function, ...not

sure of the syntax you need but I think thats your problem.



HTH



peter


  Return to Index