Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / June 2004

Tip: Looking for answers? Try searching our database.

Object oriented JScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
surya - 11 Jun 2004 03:12 GMT
Hi,

I used to assign function names to variables like

var processDataFunction = myProcessData;

where myProcessData is something like
function myProcessData()
{
}

Now I need to group all javascript functions to a JScript class like

package myPackage
{
 class myClass
 {
   var processDataFunction = myProcessData;

   function myProcessData()
   {
   }
 }
}

But, I am getting runtime exception in the line
   var processDataFunction = myProcessData;

Can a function be assigned to a var in this way? Any other ideas?

Thanks,

Surya
bruce barker - 11 Jun 2004 17:29 GMT
no.

in classic javascript, all functions were actually object contructors. in
javascript.net there are two worlds, stadalone function work as before, but
functiion declared in a class are true .net methods, and have different
rules. you need to use a delegate in your case (.net approach).

-- bruce (sqlwork.com)

> Hi,
>
[quoted text clipped - 29 lines]
>
> Surya

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.