Xbasic

RTF.INSERT_IF Function

Syntax

.INSERT_IF( Expression as C )

Arguments

Expression

The expression to evaluate to determine which instruction to process next.

Description

The .INSERT_IF() method inserts paired IF and ENDIF operators at the cursor location.

Example 

dim crtf.object as P
dim crtf.text as C
crtf.object = rtf.create(" ")
crtf.object.insert("RTF Text to stretch over one line, so you can see what full justify does", 1)
crtf.text = crtf.object.rtf_text
ui_dlg_box("Xdialog Sample", <<%dlg%
{rtf=30,10crtf};
{lf};
;
;
;
;
;
;
;
%dlg%,<<%code%
if a_dlg_button="Insert_IF" then
    crtf.object.Insert_IF("")
    a_dlg_button = ""
end if
if a_dlg_button="Insert_IF_Unpaired" then
    crtf.object.Insert_IF_Unpaired("")
    a_dlg_button = ""
end if
if a_dlg_button="Insert_IFELSE" then
    crtf.object.Insert_IFELSE("")
    a_dlg_button = ""
end if
if a_dlg_button="Insert_IFELSE_Unpaired" then
    crtf.object.Insert_IFELSE_Unpaired("")
    a_dlg_button = ""
end if
if a_dlg_button="Insert_ELSE" then
    crtf.object.Insert_Else()
    a_dlg_button = ""
end if
if a_dlg_button="Insert_ELSEIF" then
    crtf.object.Insert_ElseIF("")
    a_dlg_button = ""
end if
if a_dlg_button="Insert_ENDIF" then
    crtf.object.Insert_ENDIF()
    a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only.

See Also