473,685 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about making a property on custom object

Hello!

I got recently intrigued with JavaScript's prototype-based
object-orientation.
However, I still don't understand the mechanism clearly.

[Q1]
What's the difference between the following two?

(1)
function C(){
this.name = "Unknown"
}

(2)
function C(){
}
C.prototype.nam e = "Unknown"

[Q2]
There's no notion of Class in JavaScript and everything is an object.
How many objects are created in the following code including the
objects implicitly created in the behind?

function C(){
}

function D(){
}
D.prototype = new C

var obj = new D
[Q3]
I saw some codes like "this.base = SomeClass".
When is it needed?
Is it different from ClassName.proto type = new ParentClassName ?
[Q4]
What's the difference between prototype and __proto__?
Thanks in advance.
Sam

Jan 9 '06 #1
15 1907
Sam Kong wrote:
[Q1]
What's the difference between the following two?

(1)
function C(){
this.name = "Unknown"
}

(2)
function C(){
}
C.prototype.nam e = "Unknown"
With (1), the created object owns the property. Meaning that objects
created through the same constructor may still have different properties
and property values if they are modified afterwards.

With (2), the prototype of the created object has the property, so the
object inherits the property through the prototype chain. Meaning that
if you modify the prototype property/method `name', all objects created
through this constructor that do not own a `name' property themselves,
in a sense have their `name' property modified as in that case the
prototype chain is accessed on property access.

This has been explained in more detail very often before, please search
the archives[1] before you post.
[Q2]
There's no notion of Class in JavaScript and everything is an object.
Not true. There is no notion of classes in JavaScript implemented for HTML
user agents, and there are not only objects but also primitive values.
How many objects are created in the following code including the
objects implicitly created in the behind?

function C(){
}

function D(){
}
D.prototype = new C

var obj = new D
Four that are obvious. Two Function objects referred to by C and D each,
and two Object objects referred to by D.prototype and obj each, where D
objects (short for "objects created through the D constructor") are Object
objects that inherit from C.prototype.

window.alert([C, D, D.prototype, obj]);

Other implicitly created objects include the Global Object and all other
core objects. See ECMAScript 3 for details.[2]
[Q3]
I saw some codes like "this.base = SomeClass".
When is it needed?
When you want to (re)define a property of the object to be created, the
calling object or the Global Object; which one depends on the execution
context.
Is it different from ClassName.proto type = new ParentClassName ?
It is completely different from that. The latter makes a ParentClassName
object the prototype object of ClassName objects, and so makes ClassName
objects inherit from ParentClassName .prototype.
[Q4]
What's the difference between prototype and __proto__?


`prototype' is an identifier defined in ECMAScript for properties of
Function objects used to refer to their prototype objects.

`__proto__' is a JavaScript-proprietary identifier for properties of
all objects created through `new' to refer to the prototype objects
of their constructors; ISTM that `x.__proto__' is a shortcut for
`x.constructor. prototype' as documented[3], even though
`x.__proto__ === x.constructor.p rototype' equals `false'.
HTH

PointedEars
___________
[1] <URL:http://groups.google.c om/group/comp.lang.javas cript>
[2] <URL:http://www.mozilla.org/js/language/>
[3]
<URL:http://developer.mozil la.org/en/docs/Core_JavaScript _1.5_Guide:Deta ils_of_the_Obje ct_Model#Inheri ting_Properties >
Jan 9 '06 #2
Thomas,

Thank you for the answers.
They are very impressive and helpful.

I have a further question.

Thomas 'PointedEars' Lahn wrote:
Sam Kong wrote:
[Q1]
What's the difference between the following two?

(1)
function C(){
this.name = "Unknown"
}

(2)
function C(){
}
C.prototype.nam e = "Unknown"


With (1), the created object owns the property. Meaning that objects
created through the same constructor may still have different properties
and property values if they are modified afterwards.

With (2), the prototype of the created object has the property, so the
object inherits the property through the prototype chain. Meaning that
if you modify the prototype property/method `name', all objects created
through this constructor that do not own a `name' property themselves,
in a sense have their `name' property modified as in that case the
prototype chain is accessed on property access.


See the following code.

function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2" //HERE, I HAVE A QUESTION.

function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2"

At the last line, does it add a new slot for the property or does it
modify the value of existing property 'name'?

Thanks.

Sam

Jan 10 '06 #3
Hello,

"Sam Kong" wrote:

I got recently intrigued with JavaScript's prototype-based
object-orientation.
However, I still don't understand the mechanism clearly.

[Q1]
What's the difference between the following two?

(1)
function C(){
this.name = "Unknown"
}

(2)
function C(){
}
C.prototype.nam e = "Unknown"

when you will instanciate an object

foobar = new C();

with (1) the property "name" will be explicitly copied into the instance

with (2) the property "name" will be inherited by delegation
meaning the instance "foobar" does not have a copy of the property "name"
but can access it following the prototype chain

if you create 10 instances
wiht (1) you have 10 different "name" properties
with (2) the "name" property is shared by every instances

[Q2]
There's no notion of Class in JavaScript and everything is an object.
no but you have notion of constructors which can "emulate" classes

cf ECMA-262 4.2.1
"ECMAScript does not contain proper classes such as those in C++, Smalltalk,
or Java, but rather, supports constructors which create objects by executing
code that allocates storage for the objects and initialises all or part of
them by assigning initial values to their properties. All constructors are
objects, but not all objects are constructors. Each constructor has a
Prototype property that is used to implement prototype-based inheritance and
shared properties. Objects are created by using constructors in new
expressions; for example, new String("A String") creates a new String
object. Invoking a constructor without using new has consequences that
depend on the constructor. For example, String("A String") produces a
primitive string, not an object."

see http://www.ecma-international.org/pu...s/Ecma-262.htm
How many objects are created in the following code including the
objects implicitly created in the behind?

function C(){
}

function D(){
}
D.prototype = new C

var obj = new D

for the segment of code above

4 if you consider the creation of a prototype property as
not-an-object-instanciation

function are objects, once you declare one you create an object
when you use the "new" keyword you instanciate an object

5 if you consider that the creation of the prototype property is an object
instanciation

function C in the behind automatically define a "prototype" property
which is equivalent to
C.prototype = Function.protot ype;

see ECMA-262 13.2 Creating Function Object
"
[...]
4. Set the [[Prototype]] property of F to the original Function prototype
object as specified in section 15.3.3.1.
[...]
9. Create a new object as would be constructed by the expression new
Object().

10. Set the constructor property of Result(9) to F. This property is given
attributes { DontEnum }.

11. Set the prototype property of F to Result(9). This property is given
attributes as specified in section 15.3.5.2.
[...]
NOTE A prototype property is automatically created for every function,
to allow for the possibility that the function will be used as a
constructor.
"

and


just writing
function C() {
}

DO create
C.prototype = new Object();

[Q3]
I saw some codes like "this.base = SomeClass".
When is it needed?
Is it different from ClassName.proto type = new ParentClassName ?

could you provide some code constructs ?

I will try to "guess"...

usually when you want to inherit a constructor

you can do

function A(){
}

function B(){
}

B.prototype = new A();

but doing that you override the original B "prototype" property
and so you override also the "constructo r" property contained in "prototype"

foo = new A();
//foo.constructor == A

bar = new B();
//bar.constructor == A, and not B

to correct this behaviour you can reassign the constructor property after
overriding the prototype

function B(){
}

B.prototype = new A();
B.prototype.con structor = B;

so now when you instanciate an objet with the B constructor function

bar = new B();
//bar.constructor == B
for the "this.base = SomeClass".
I suppose you seen that in that context to emulate superClass constructor
call

function A( x ){
this.x = x;
}

function B( x, y ){
this.base = A;
this.base( x );
this.y = y;
}

B.prototype = new A();

in this case "this.base" allow to execute A constructor inside the B
constructor
but with the B function scope, so the "x" is created in the context of B and
not A

alternatively you can also do that

function B( x, y ){
A.call( this, x ); // equivalent to "super( x )"
this.y = y;
}

B.prototype = new A();

[Q4]
What's the difference between prototype and __proto__?


first let's define a context

function A(){
}

foobar = new A();

in the context of "foobar"
foobar.prototyp e does NOT exist
foobar.construc tor is a pointer to A constructor function (hence the name)
foobar.__proto_ _ is a pointer to A.prototype object

in the context of "A"
A.prototype is an instancied object
(see above "9. Create a new object as would be constructed by the expression
new Object().")

here what we obtain with JSDB (www.jsdb.org)
------------------------------------
function A()
{

}
foobar = new A();

println( foobar.construc tor === A ); //true
println( foobar.prototyp e === undefined ); //true
println( foobar.__proto_ _ === A.prototype ); //true
println( foobar.construc tor.prototype === A.prototype ); //true
println( "--" );
println( (A.prototype).c onstructor === A ); //true
println( (A.prototype).p rototype === undefined ); //true
println( (A.prototype)._ _proto__ === Object.prototyp e ); //true
println( (A.prototype).c onstructor.prot otype === A.prototype ); //true
println( "--" );
println( A.constructor === Function ); //true
println( A.prototype !== undefined ); //true
println( A.__proto__ === Function.protot ype ); //true
println( A.constructor.p rototype === Function.protot ype ); //true
println( "--" );
println( foobar instanceof A ); //true
println( A instanceof Function ); //true
println( A.prototype instanceof Object ); //true
------------------------------------

there are 3 different objects

A is a Function object
A.prototype is an Object object
foobar is an A object

each object as its own constructor property pointing to the function who
created it

each objects as its own __proto__ property pointing to the
function.protot ype who created it
(except if you override the prototype doins something as, A.prototype = new
B() )

A is a "special case" because it's a Function object
so a prototype property is automatically assigned him
by default this property is a simple Object object

for hosts implementing __proto__
you can see __proto__ as the "visible" or "accessible " constructor prototype

zwetan
Jan 10 '06 #4
Sam Kong escreveu:
I have a further question.
function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2" //HERE, I HAVE A QUESTION.

At the last line, does it add a new slot for the property or does it
modify the value of existing property 'name'?


If you really need such information, you should read the spec, anyway I
think I doesn't modify anything, since JavaScript has a garbage
collector... It may create a hash for the "name" property, look for it
in a list, if not found, it's added, then it receives the reference to
the value, as the previous reference to the previous object is lost, it
may be garbage collected.
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com

Jan 10 '06 #5
Sam Kong escreveu:
I have a further question.
function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2" //HERE, I HAVE A QUESTION.

At the last line, does it add a new slot for the property or does it
modify the value of existing property 'name'?


If you really need such information, you should read the spec, anyway I
think It doesn't modify anything, since JavaScript has a garbage
collector... It may create a hash for the "name" property, look for it
in a list, if not found, it's added, then it receives the reference to
the value, as the previous reference to the previous object is lost, it
may be garbage collected.
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com

Jan 10 '06 #6

"Sam Kong" wrote:
[snip]

var obj = new D
obj.name = "Test2" //HERE, I HAVE A QUESTION.

function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2"

At the last line, does it add a new slot for the property or does it
modify the value of existing property 'name'?


it add a new slot

any member defined as a property of an instance
explicitly override any inherited by delegation member
function A(){
}

A.prototype.tes t = "hello";

A.prototype.bla h = function(){
return "[" + this.test + "]";
}

foo = new A();
foo.test = "bonjour";
foo.blah = function(){
return "{" + this.test + "}";
}

bar = newA();

println( A.prototype.tes t ); //"hello"
println( foo.test ); //"bonjour"
println( foo.blah() ); //"{bonjour}"
println( bar.test ); //"hello"
println( bar.blah() ); //"[hello]"
zwetan




Jan 10 '06 #7
Wow, zwetan.
Your explanation is so amazing.
You surely mastered JavaScript, I guess...

zwetan wrote:
Hello,

"Sam Kong" wrote:

I got recently intrigued with JavaScript's prototype-based
object-orientation.
However, I still don't understand the mechanism clearly.

[Q1]
What's the difference between the following two?

(1)
function C(){
this.name = "Unknown"
}

(2)
function C(){
}
C.prototype.nam e = "Unknown"

when you will instanciate an object

foobar = new C();

with (1) the property "name" will be explicitly copied into the instance

with (2) the property "name" will be inherited by delegation
meaning the instance "foobar" does not have a copy of the property "name"
but can access it following the prototype chain

if you create 10 instances
wiht (1) you have 10 different "name" properties
with (2) the "name" property is shared by every instances


One more question here.

(1)
function C(){
this.f = function(){...}
}

(2)
function my_f(){...}

function C(){
this.f = my_f
}

In (2), does the method assignment copy function itself, or does it
just copy function reference?
I guess, in (1), every object of C will have its own function and in
(2) there's only one function and it will be shared. Am I right?

And the best way would be...

(3)
function my_f(){...}
function C(){
}
C.prototype.f = my_f()

Right?

[Q2]
There's no notion of Class in JavaScript and everything is an object.
no but you have notion of constructors which can "emulate" classes

cf ECMA-262 4.2.1
"ECMAScript does not contain proper classes such as those in C++, Smalltalk,
or Java, but rather, supports constructors which create objects by executing
code that allocates storage for the objects and initialises all or part of
them by assigning initial values to their properties. All constructors are
objects, but not all objects are constructors. Each constructor has a
Prototype property that is used to implement prototype-based inheritance and
shared properties. Objects are created by using constructors in new
expressions; for example, new String("A String") creates a new String
object. Invoking a constructor without using new has consequences that
depend on the constructor. For example, String("A String") produces a
primitive string, not an object."

see http://www.ecma-international.org/pu...s/Ecma-262.htm
How many objects are created in the following code including the
objects implicitly created in the behind?

function C(){
}

function D(){
}
D.prototype = new C

var obj = new D


for the segment of code above

4 if you consider the creation of a prototype property as
not-an-object-instanciation

function are objects, once you declare one you create an object
when you use the "new" keyword you instanciate an object

5 if you consider that the creation of the prototype property is an object
instanciation

function C in the behind automatically define a "prototype" property
which is equivalent to
C.prototype = Function.protot ype;


I didn't consider this case....

see ECMA-262 13.2 Creating Function Object
"
[...]
4. Set the [[Prototype]] property of F to the original Function prototype
object as specified in section 15.3.3.1.
[...]
9. Create a new object as would be constructed by the expression new
Object().

10. Set the constructor property of Result(9) to F. This property is given
attributes { DontEnum }.

11. Set the prototype property of F to Result(9). This property is given
attributes as specified in section 15.3.5.2.
[...]
NOTE A prototype property is automatically created for every function,
to allow for the possibility that the function will be used as a
constructor.
"

and


just writing
function C() {
}

DO create
C.prototype = new Object();

[Q3]
I saw some codes like "this.base = SomeClass".
When is it needed?
Is it different from ClassName.proto type = new ParentClassName ?

could you provide some code constructs ?

I will try to "guess"...


Your guess is correct in every aspect.

usually when you want to inherit a constructor

you can do

function A(){
}

function B(){
}

B.prototype = new A();

but doing that you override the original B "prototype" property
and so you override also the "constructo r" property contained in "prototype"

foo = new A();
//foo.constructor == A

bar = new B();
//bar.constructor == A, and not B

to correct this behaviour you can reassign the constructor property after
overriding the prototype

function B(){
}

B.prototype = new A();
B.prototype.con structor = B;

so now when you instanciate an objet with the B constructor function

bar = new B();
//bar.constructor == B
for the "this.base = SomeClass".
I suppose you seen that in that context to emulate superClass constructor
call

function A( x ){
this.x = x;
}

function B( x, y ){
this.base = A;
this.base( x );
this.y = y;
}

B.prototype = new A();

in this case "this.base" allow to execute A constructor inside the B
constructor
but with the B function scope, so the "x" is created in the context of B and
not A

alternatively you can also do that

function B( x, y ){
A.call( this, x ); // equivalent to "super( x )"
this.y = y;
}

B.prototype = new A();

[Q4]
What's the difference between prototype and __proto__?


first let's define a context

function A(){
}

foobar = new A();

in the context of "foobar"
foobar.prototyp e does NOT exist
foobar.construc tor is a pointer to A constructor function (hence the name)
foobar.__proto_ _ is a pointer to A.prototype object

in the context of "A"
A.prototype is an instancied object
(see above "9. Create a new object as would be constructed by the expression
new Object().")

here what we obtain with JSDB (www.jsdb.org)
------------------------------------
function A()
{

}
foobar = new A();

println( foobar.construc tor === A ); //true
println( foobar.prototyp e === undefined ); //true
println( foobar.__proto_ _ === A.prototype ); //true
println( foobar.construc tor.prototype === A.prototype ); //true
println( "--" );
println( (A.prototype).c onstructor === A ); //true
println( (A.prototype).p rototype === undefined ); //true
println( (A.prototype)._ _proto__ === Object.prototyp e ); //true
println( (A.prototype).c onstructor.prot otype === A.prototype ); //true
println( "--" );
println( A.constructor === Function ); //true
println( A.prototype !== undefined ); //true
println( A.__proto__ === Function.protot ype ); //true
println( A.constructor.p rototype === Function.protot ype ); //true
println( "--" );
println( foobar instanceof A ); //true
println( A instanceof Function ); //true
println( A.prototype instanceof Object ); //true
------------------------------------

there are 3 different objects

A is a Function object
A.prototype is an Object object
foobar is an A object

each object as its own constructor property pointing to the function who
created it

each objects as its own __proto__ property pointing to the
function.protot ype who created it
(except if you override the prototype doins something as, A.prototype = new
B() )

A is a "special case" because it's a Function object
so a prototype property is automatically assigned him
by default this property is a simple Object object

for hosts implementing __proto__
you can see __proto__ as the "visible" or "accessible " constructor prototype

zwetan


It will take me some time to understand what you explained.

I've been developing web sites for years and I used only JavaScript's
basic functions (just calling functions, not object-oriented).
I'm a big fan of Ruby and some ruby guys directed me to Io language
which is a prototype-based language.
I found out that JavaScript is also a prototype-based language and is
very powerful than I thought.
I decided to study JavaScript more.

Now I think JavaScript is very consistent and logical, simple but
powerful and flexible.
I may use JavaScript for general solutions as well as web client
script.

Thanks for your great explanation.

Sam

Jan 10 '06 #8
Sam Kong escreveu:
zwetan wrote:
"Sam Kong" wrote: Wow, zwetan.
Your explanation is so amazing.
You surely mastered JavaScript, I guess...


lol, there are a lot of people with a great knowledge of this language
here, maybe because it's simple and fast to learn :)
(1)
function C(){ this.f = function(){...} }

(2)
function my_f(){...}
function C(){ this.f = my_f }

In (2), does the method assignment copy function itself, or does it
just copy function reference?
Reference...

Everything is passed by reference, but primitive values, like: true,
123 or "abc"... But if you create them as objects (new Boolean, new
String...), they will be passed by reference too.
I guess, in (1), every object of C will have its own function and in
(2) there's only one function and it will be shared. Am I right?
Yeah :)
And the best way would be...

(3)
function my_f(){...}
function C(){
}
C.prototype.f = my_f()

Right?


Right, but if you're not going to share the function "my_f", I preffer
an anonymous one:

C.prototype.f = function(){};

I won't read the rest of the message, It's quite long haha ;]
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com

Jan 10 '06 #9
Sam Kong wrote:
Thomas,

Thank you for the answers.
You're welcome.
They are very impressive and helpful.
Thanks, too.
[...]

function C(){
this.name = "Test" ^
Most statements, especially simple assignments, should be ended with
a semicolon to avoid undesired side-effects with automatic semicolon
insertion by the script engine.
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2" //HERE, I HAVE A QUESTION.
Please do not SHOUT on Usenet.
function C(){
this.name = "Test"
}

function D(){
}
D.prototype = new C

var obj = new D
obj.name = "Test2"

At the last line, does it add a new slot for the property or does it
modify the value of existing property 'name'?


It depends on how you interpret "object has property":

If you choose to say that objects have all properties, including those
that they merely inherit from other objects through the prototype chain,
then the last line merely modifies an existing property value.

If you choose to say instead that objects have only those properties that
they own (called "local properties" in the JavaScript documentation; not
to be confused with local variables), the object is added a new (local)
property which supersedes the inherited property value as long as it exists
local property exists because if it exists, the prototype chain is unused
for that accessing the property of that name.

You can think of an inherited property value as a default value for a
property provided by the prototype, one that can be restored when you
delete the local property with the same name (that is, apply the `delete'
operator on that property:

delete obj.name;
alert(obj.name) ; // "Test", as inherited from D.prototype

Note that if you do not call C() in D() with the object to be created as
the calling object -- that is, either

function D()
{
C.call(this, ...);
}

or

function D()
{
C.apply(this, ...);
}

or, if none of the above is available,

function D()
{
this.base = C; // you can use any unused name for this property
this.base(...);
}

-- as it is in your code, the inheritance implementation is not complete.
Lasse R. Nielsen has provided code here that shows the respective
side-effect:

news:u0******** **@hotpop.com
or
<URL:http://groups.google.d e/group/comp.lang.javas cript/browse_thread/thread/93e3f206994a1bf/8a59bba12a022e1 a?lnk=st&q=prot otype+push+auth or%3Anielsen+gr oup%3Acomp.lang .javascript&rnu m=4&hl=de#8a59b ba12a022e1a>

Please consult the available documentation and do practice tests before
you ask further basic questions here. <URL:http://jibbering.com/faq/>
PointedEars
Jan 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
1857
by: designconcepts | last post by:
bo'jour, bo'jour, So I have question to present to the forum about OOD. This is a Csharp forum, but C# is the lang of choice and the question is an exercise based on some comments by the chief designer of C#. Those of you who are junkies for design principle might be interested in contributing to this thread. I was recently reading some interviews with the chief engineer for C# (formerly Mr. Delphi), and he made an interesting comment...
3
1976
by: Frank Wisniewski | last post by:
I have the following persudo code: //My Form Class class Form1 { //Local Variable for my custom object private MyCustomObject1 //Constructor for Form Class public Constructor{
3
1904
by: pnp | last post by:
When I use a custom class object as the selected object of a property gird control is there a way to set custom names fro the grouped sections shown in it? Thanks, Peter
14
3131
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them... (both are "Pascal Case" with no leading or trailing qualifiers). For example... I'll be modelling something, e.g. a computer, and I'll
5
1805
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the property '.fulladdress' to be the value that appears in the drop downs text section. How to I set that parameter to be the one shown inthe drop down
6
1439
by: Chris | last post by:
Hi all, I've recently discovered the joys of tag :) I have a ListView which is populated with strings from a List<>, and each ListView item is linked to the relevant object in List<> using Tag. The ListView is on a parent form, and I have a child form which adds items to List<>. So I pass the List<> by ref*, the relevant objects are created in the List<> and the ListView is updated in the parent form. I'm now trying to edit items in the...
10
2833
by: INeedADip | last post by:
I am trying to use a generic (reflection) IComparer class to sort a generic list but I get the error: Unable to cast object of type 'GenericComparer' to type 'System.Collections.Generic.Icomparer `1' My code looks like the following: List<AccountDB.Queue> oList = getAllQueuesFunction(); List.Sort(New GenericComparer("QueueName")); <-- Error
6
1430
by: Peter Richardson | last post by:
Hi, I'm wondering if someone can help me with some design questions I have. I'm trying to create a class in C# to represent my customers. I know how to create teh Customer class and all, but my problem comes with some conceptual issues I have: Let's say I have a business layer and a data layer. I use a seperate assembly to host the business objects that I pass from one to another. That is, I have for example:
9
2800
by: =?Utf-8?B?VGVycnk=?= | last post by:
Think it is great the way that you can set up a datsource, value member, and display member for a combobox, and map a 'code' to a 'description' and back again by binding the combobox to a datasource that contains the code. Now suppose that you want it to be read-only? That is, you have the 'code' in your DB, want the associated 'description' to display, but not let the user change it on this particular form. There is no read-only...
0
8570
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8504
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8925
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8758
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7584
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5790
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.