473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

retrieving name of a class?

Let's say that I've created an object:

Expand|Select|Wrap|Line Numbers
  1. var Model = Class.create();
  2. Model.prototype = { ... }
  3. Search = new Model();
  4.  
I can't for the life of me get my Model object to tell me that it's name is Search.

Anyone have a clever trick?

Pete
Jan 27 '07 #1
1 945
b1randon
171 Expert 100+
Let's say that I've created an object:

Expand|Select|Wrap|Line Numbers
  1. var Model = Class.create();
  2. Model.prototype = { ... }
  3. Search = new Model();
  4.  
I can't for the life of me get my Model object to tell me that it's name is Search.

Anyone have a clever trick?

Pete
It is sort of hard to imagine why you want to do that. But one thing you could do is pass "search" as a parameter to your constructor and in the constructor you can set a member variable called name to "search". Then your model class would know the name of the variable it was stored under. It is still a weird problem. Please post more about why you're doing that.
Jan 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jan axelson | last post by:
My application is using RegisterDeviceNotification() to detect attachment and removal of a USB HID-class device. The form is receiving WM_DEVICECHANGE messages with wParam set to...
5
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are...
3
by: Michel Vanderbeke | last post by:
Hello, While logging the errors in my program, I want to know in which class, function or procedure they occured. Is it possible to know the name of the class, function and / or procedure in...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
0
by: asti1987 | last post by:
I have a big problem, y need to print a jasper report, but it must to be with jsp. this is my jsp please help me <%@ page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.