「Perl VBのプロパティプロシージャを生成」の版間の差分
ナビゲーションに移動
検索に移動
(ページの作成:「==Perl VBのプロパティプロシージャを生成== #プロパティ @props = ( "fieldName", "fieldLogicalName", "dataType",…」) |
|||
| (同じ利用者による、間の1版が非表示) | |||
| 1行目: | 1行目: | ||
| − | ==Perl VBのプロパティプロシージャを生成== | + | ==[[Perl VBのプロパティプロシージャを生成]]== |
#プロパティ | #プロパティ | ||
| 12行目: | 12行目: | ||
#プロパティの型 | #プロパティの型 | ||
%types = ( | %types = ( | ||
| − | "fieldName" = | + | "fieldName" =>"String", |
| − | "fieldLogicalName" = | + | "fieldLogicalName" =>"String", |
| − | "dataType" = | + | "dataType" =>"String", |
| − | "byteSize" = | + | "byteSize" =>"String", |
| − | "dataLength" = | + | "dataLength" =>"String", |
| − | "notes" = | + | "notes" =>"String" |
); | ); | ||
#プロパティのコメント | #プロパティのコメント | ||
%comments = ( | %comments = ( | ||
| − | "fieldName" = | + | "fieldName" =>"列名(物理)", |
| − | "fieldLogicalName" = | + | "fieldLogicalName" =>"列名(論理)", |
| − | "dataType" = | + | "dataType" =>"データ型", |
| − | "byteSize" = | + | "byteSize" =>"バイト数", |
| − | "dataLength" = | + | "dataLength" =>"桁数", |
| − | "notes" = | + | "notes" =>"備考" |
); | ); | ||
$prop_cnt = @props; | $prop_cnt = @props; | ||
| − | for ($i=0; $i | + | for ($i=0; $i<$prop_cnt; $i++) { |
$prop_name = @props[$i]; | $prop_name = @props[$i]; | ||
$prop_type = $types{$prop_name}; | $prop_type = $types{$prop_name}; | ||
| 38行目: | 38行目: | ||
} | } | ||
print "\n\n"; | print "\n\n"; | ||
| − | for ($i=0; $i | + | for ($i=0; $i<$prop_cnt; $i++) { |
$prop_name = @props[$i]; | $prop_name = @props[$i]; | ||
$prop_type = $types{$prop_name}; | $prop_type = $types{$prop_name}; | ||
2020年2月16日 (日) 04:30時点における最新版
Perl VBのプロパティプロシージャを生成
#プロパティ
@props = (
"fieldName",
"fieldLogicalName",
"dataType",
"byteSize",
"dataLength",
"notes"
);
#プロパティの型
%types = (
"fieldName" =>"String",
"fieldLogicalName" =>"String",
"dataType" =>"String",
"byteSize" =>"String",
"dataLength" =>"String",
"notes" =>"String"
);
#プロパティのコメント
%comments = (
"fieldName" =>"列名(物理)",
"fieldLogicalName" =>"列名(論理)",
"dataType" =>"データ型",
"byteSize" =>"バイト数",
"dataLength" =>"桁数",
"notes" =>"備考"
);
$prop_cnt = @props;
for ($i=0; $i<$prop_cnt; $i++) {
$prop_name = @props[$i];
$prop_type = $types{$prop_name};
$comment = $comments{$prop_name};
print "Private m_$prop_name \t\t\tAs $prop_type\t'$comment\n";
}
print "\n\n";
for ($i=0; $i<$prop_cnt; $i++) {
$prop_name = @props[$i];
$prop_type = $types{$prop_name};
$comment = $comments{$prop_name};
print "'$comment を取得する\n";
print "Public Property Get $prop_name() As $prop_type\n";
print " $prop_name = m_$prop_name\n";
print "End Property\n";
print "'$comment を設定する\n";
print "Public Property Let $prop_name(ByVal new_$prop_name As $prop_type)\n";
print " m_$prop_name = new_$prop_name\n";
print "End Property\n";
}
© 2006 矢木浩人