<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JScript: имитация описания собственных классов]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=1101&amp;type=atom" />
	<updated>2008-01-31T10:27:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=1101</id>
		<entry>
			<title type="html"><![CDATA[JScript: имитация описания собственных классов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=8520#p8520" />
			<content type="html"><![CDATA[<p>Пример описания и использования &quot;класса&quot; (собственного объекта) myStruct со свойством myAttrib и методом myMethod:<br /></p><div class="codebox"><pre><code>function myStruct(a)
{
    this.myAttrib = a;
    this.myMethod = function(d)
    {
        var tmp = this.myAttrib;
        this.myAttrib += d;
        return tmp;
    };
}

var t1 = new myStruct(1);

WScript.Echo(t1.myAttrib);
WScript.Echo(t1.myMethod(1));
WScript.Echo(t1.myAttrib);</code></pre></div><p>Благодарность за разъяснения - <strong>kos</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-01-31T10:27:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=8520#p8520</id>
		</entry>
</feed>
