<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Me &#8211; カミュプリィの雑多なメモ</title>
	<atom:link href="https://www.commuply.co.jp/technic/memo/tag/me/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.commuply.co.jp/technic/memo</link>
	<description></description>
	<lastBuildDate>Fri, 09 May 2025 12:23:38 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.commuply.co.jp/technic/memo/wp-content/uploads/site-icon-150x150.png</url>
	<title>Me &#8211; カミュプリィの雑多なメモ</title>
	<link>https://www.commuply.co.jp/technic/memo</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>[言語比較]Class : クラスをつくる</title>
		<link>https://www.commuply.co.jp/technic/memo/make-class/</link>
		
		<dc:creator><![CDATA[ume]]></dc:creator>
		<pubDate>Thu, 17 Mar 2022 01:53:12 +0000</pubDate>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[As]]></category>
		<category><![CDATA[ByRef]]></category>
		<category><![CDATA[ByVal]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Class_Initialize]]></category>
		<category><![CDATA[Class_Terminate]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[End Class]]></category>
		<category><![CDATA[End Function]]></category>
		<category><![CDATA[End Property]]></category>
		<category><![CDATA[End Sub]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Lotus Script]]></category>
		<category><![CDATA[Me]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[Private]]></category>
		<category><![CDATA[Property Get]]></category>
		<category><![CDATA[Property Let]]></category>
		<category><![CDATA[Property Set]]></category>
		<category><![CDATA[Public]]></category>
		<category><![CDATA[Sub]]></category>
		<category><![CDATA[Sub New]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[言語比較]]></category>
		<guid isPermaLink="false">https://www.commuply.co.jp/technic/notesdomino/?p=71</guid>

					<description><![CDATA[　Lotus Scriptのクラスは、VBScriptと異なっているところが多いです。 Lotus Script 言語 Class クラス名 As 元クラス　’別のクラスから引き継ぐことができます 　’最初に実行されます [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>　Lotus Scriptのクラスは、VBScriptと異なっているところが多いです。</p>


<h2 class="wp-block-heading has-base-2-background-color has-background" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--20)" id="lotus-script-%25e8%25a8%2580%25e8%25aa%259e">Lotus Script 言語</h2>


<p><strong>Class クラス名 As 元クラス</strong>　’別のクラスから引き継ぐことができます</p>



<p>　’最初に実行されます<br>　<strong>Sub New （変数名 As 型）．元クラス （変数名 As 型）</strong>　’値を受け取ることができます<br>　<strong>End Sub</strong></p>



<p>　’最後に実行されます<br>　<strong>Sub Delete （）</strong><br>　<strong>End Sub</strong></p>



<p>　<strong>Public Sub 戻り値がない関数名 （変数名 As 型）</strong><br>　<strong>End Sub</strong><br>&#8216;使うときは「Call クラスオブジェクト.関数名(値)」です</p>



<p>　<strong>Public Function 戻り値がある関数名 （変数名 As 型） As 型</strong><br>　　Me.戻り値がある関数名 ＝ 戻り値　’値を返します<br>　<strong>End Function</strong><br>&#8216;使うときは「値 = クラスオブジェクト.関数名(値)」です<br>&#8216;または「Set 値 = クラスオブジェクト.関数名(値)」です</p>



<p>　<strong>Public Property Set プロパティ名 As 型</strong> &#8216; Lotus Script では Let は Set に統合されています<br>　　変数名 ＝ Me.プロパティ名　’値を受け取ります<br>　　（または） <strong>Set</strong> 変数名 ＝ Me.プロパティ名　’値を受け取ります<br>　<strong>End Property</strong><br>&#8216;使うときは「クラスオブジェクト.プロパティ名 = 値」です<br>&#8216;または「Set クラスオブジェクト.プロパティ名 = 値」です</p>



<p>　<strong>Public Property Get プロパティ名 As 型</strong><br>　　Me.プロパティ名 ＝ 戻り値　’値を返します<br>　<strong>End Property</strong><br>&#8216;使うときは「値 = クラスオブジェクト.プロパティ名」です<br>&#8216;または「Set 値 = クラスオブジェクト.プロパティ名」です</p>



<p><strong>End Class</strong></p>



<p>　何も指定しないと Private、ByRef になります。<br>　現在のクラスのなかで現在のクラスで定義された関数・プロパティ・変数を使うには、名前の先頭に Me. をつければＯＫです</p>


<h2 class="wp-block-heading has-base-2-background-color has-background" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--20)" id="vbscript-%25e8%25a8%2580%25e8%25aa%259e">VbScript 言語</h2>


<p><strong>Class クラス名</strong>　’独立したクラスとして作成します</p>



<p>　’最初に実行されます<br>　<strong>Sub Class_Initialize （）</strong>　’値を受け取れません<br>　<strong>End Sub</strong></p>



<p>　’最後に実行されます<br>　<strong>Sub Class_Terminate （）</strong><br>　<strong>End Sub</strong></p>



<p><strong>Sub 戻り値がない関数名 （変数名）</strong><br><strong>End Sub</strong><br>&#8216;使うときは「Call クラスオブジェクト.関数名(値)」です</p>



<p><strong>Function 戻り値がある関数名 （変数名）</strong><br>　戻り値がある関数名 ＝ 戻り値　’値を返します<br><strong>End Function</strong><br>&#8216;使うときは「値 = クラスオブジェクト.関数名(値)」です<br>&#8216;または「Set 値 = クラスオブジェクト.関数名(値)」です</p>



<p><strong>Public Property Set プロパティ名</strong>　’Set はオブジェクトを受け取ります<br>　Set 変数名 ＝ プロパティ名　’値を受け取ります<br><strong>End Property</strong><br>&#8216;使うときは「Set クラスオブジェクト.プロパティ名 = 値」です</p>



<p><strong>Public Property Let プロパティ名</strong>　’Let はオブジェクト以外を受け取ります<br>　変数名 ＝ プロパティ名　’値を受け取ります<br><strong>End Property</strong><br>&#8216;使うときは「クラスオブジェクト.プロパティ名 = 値」です</p>



<p><strong>Public Property Get プロパティ名</strong><br>　プロパティ名 ＝ 戻り値　’値を返します<br><strong>End Property</strong><br>&#8216;使うときは「値 = クラスオブジェクト.プロパティ名」です<br>&#8216;または「Set 値 = クラスオブジェクト.プロパティ名」です</p>



<p><strong>End Class</strong><br><br>　なにも指定しないと Public、ByRef になります。<br>　現在のクラスで定義されたプロパティをつかうときに、名前の先頭に Me. をつけるときがあります</p>


<h2 class="wp-block-heading" id="vba-for-excel-word-%25e3%2581%25aa%25e3%2581%25a9">VBA (for Excel, Word など)</h2>


<p>　VBAのクラスは Visual Basic Editor のメニューの挿入からクラスモジュールを選ぶことで作成できます。ひとつのページ（？）に複数のクラスを記述することができません<br>　クラスをエクスポートすると、次のようなヘッダーが付いてきます<br>　ここに記述したものすべては単一のクラス内のものとして扱われます</p>



<pre class="wp-block-code"><code>VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "クラス名"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True

（ここに関数ほかを記述します）</code></pre>



<pre class="wp-block-code"><code>’最初に実行されます
Private Sub Class_Initialize()　’値を受け取れません
End Sub
'使うときは「New クラス名」です</code></pre>



<pre class="wp-block-code"><code>’最後に実行されます
Private Sub Class_Terminate()
End Sub
'使うときは「Set クラス変数 = Nothing」です</code></pre>



<pre class="wp-block-code"><code>Public Sub 戻り値がない関数名(変数名) ' 複数の変数を指定するときはカンマ(,)で区切ります
End Sub
'使うときは「Call クラスオブジェクト.関数名(値)」です
'または「Call クラスオブジェクト.関数名(<strong>変数名:=</strong>値)」です</code></pre>



<pre class="wp-block-code"><code>Public Function 戻り値がある関数名(変数名)
	戻り値がある関数名 = 戻り値　’値を返します
End Function
'使うときは「値 = クラスオブジェクト.関数名(変数名)」です
'または「Set 値 = クラスオブジェクト.関数名(変数名)」です</code></pre>



<pre class="wp-block-code"><code>Public Property Get <strong>プロパティ名</strong>
	プロパティ名 = 戻り値　’値を返します
End Property
'使うときは「値 = クラスオブジェクト.プロパティ名」です</code></pre>



<pre class="wp-block-code"><code>Public Property Let <strong>プロパティ名(変数名)</strong>　’Let はオブジェクト以外を受け取ります
	変数名 = プロパティ名　’値を受け取ります
End Property
'使うときは「クラスオブジェクト.プロパティ名 = 値」です</code></pre>



<pre class="wp-block-code"><code>Public Property Set <strong>プロパティ名(変数名)</strong>　’Set はオブジェクトを受け取ります
	Set 変数名 = プロパティ名　’値を受け取ります
End Property
'使うときは「Set クラスオブジェクト.プロパティ名 = 値」です</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
