ここは旧式の4DドキュメントWebサイトです。最新のアップデートされたドキュメントを読むには新サイトをご利用下さい→ developer.4d.com

ホーム

 
4D v19
WP Get subsection

WP Get subsection 


 

WP Get subsection ( targetObj ) | (wpSection ; subSectionType ) -> 戻り値 
引数   説明
targetObj  オブジェクト in レンジまたは要素
wpSection  オブジェクト in 4D Write Pro セクション
subSectionType  倍長整数 in サブセクションのタイプ(wk first page, wk left page, または wk right page)
戻り値  オブジェクト in サブセクション

説明   

WP Get subsection コマンドは、targetObj 引数で指定したレンジまたは要素と交差する最初のサブセクション、あるいはwpSection 引数のセクション内のsubSectionType 型のサブセクションを返します。

  • 最初のシンタックス(targetObj 引数を使用)では、コマンドはレンジまたは要素と交差する最初のサブセクションを返します。レンジまたは要素と交差するサブセクションがない場合、null オブジェクトが返されます。targetObj 引数には、以下のいづれかを渡すことができます:
    • レンジ
    • 要素(表 / 行 / 段落 / 本文 / ヘッダー / フッター )

    レンジまたは要素がヘッダーあるいはフッターに所属している場合、WP Get subsection はそのヘッダーあるいはフッターが割り当てられているサブセクションを返します。ヘッダーまたはフッターがサブセクションに割り当てられていない場合、null オブジェクトが返されます。
    レンジまたは要素がアンカーされた画像に所属している場合、エラーが返されます。

  • 第二シンタックス(wpSection および subSectionType 引数を使用)では、コマンドはsubSectionType タイプのwpSubSection サブセクションオブジェクト(wpSection の子)を返します。subSectionType 引数には以下の定数のいづれか一つを渡します:
     
    定数
    wk first page 倍長整数 1
    wk left page 倍長整数 2
    wk right page 倍長整数 3


    wpSection 引数で指定したセクションにsubSectionType 引数のタイプのサブセクションが定義されていない場合、 コマンドは未定義のオブジェクトを返します(エラーは返されません)。

例題  

左ページに青い背景を適用したい場合を考えます:

 C_OBJECT($section;$subsection)
  //最初のセクションを取得
 $section:=WP Get section(wpDoc;1)
  //最初のセクションの左ページサブセクションへを取得
 $subsection:=WP Get subsection($section;wk left page)
 
  //サブセクションが存在する場合、背景を青に設定
 If($subsection#Null)
    WP SET ATTRIBUTES($subsection;wk background color;"#87CEEB")
 Else
    ALERT("Please, create left and right subsections.")
 End if



参照 

WP DELETE SUBSECTION
WP Get section
WP New subsection

 
プロパティ 

プロダクト: 4D
テーマ: 4D Write Proランゲージ
番号: 1582

This command can be run in preemptive processes

 
ページの目次 
 
履歴 

初出: 4D v17 R3

 
ARTICLE USAGE

4D Write Proリファレンス ( 4D v19)