4D Write v16WR INSERT HYPERLINK |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Write v16
WR INSERT HYPERLINK
|
WR INSERT HYPERLINK ( area ; linkType ; urlStyle ; linkLabel ; linkContent ; methodRef ) | ||||||||
Parameter | Type | Description | ||||||
area | Longint |
![]() |
4D Write area | |||||
linkType | Integer |
![]() |
Hyperlink type: 0 = Method, 1 = URL, 2 = 4D Write Document | |||||
urlStyle | Integer |
![]() |
URL appearance: 1 = Default style, 0 = Custom style | |||||
linkLabel | Text |
![]() |
Link’s visible text (View/Values mode) | |||||
linkContent | Text |
![]() |
Hyperlink value | |||||
methodRef | Longint |
![]() |
Value for $3, 3rd parameter of the method (if the link type is Method) | |||||
The WR INSERT HYPERLINK command inserts a “hyperlink” reference within area, at the current cursor location or in place of the current text selection.
linkType
The linkType parameter defines the type of hypertext link to insert. 4D Write allows for three types of hypertext links: Method type links, URL type links, and Document type links.
In the linkType parameter, pass one of the following constants, found in the "WR Parameters" theme:
Constant | Type | Value | Comment |
wr method type link | Longint | 0 | Inserts a Method type link |
wr URL type link | Longint | 1 | Inserts a URL type link |
wr document type link | Longint | 2 | Inserts a Document type link |
urlStyle:
The urlStyle parameter allows you to define the appearance of the inserted hypertext link. In this parameter, you can pass one of the following constants, found in the "WR Parameters" theme:
Constant | Type | Value | Comment |
wr custom link appearance | Longint | 0 | Allows the use of a customized appearance. In this case, you can select the link and define the style using the WR SET TEXT PROPERTY command. |
wr default link appearance | Longint | 1 | Keeps the default hyperlink appearance (blue and underlined). Default colors can be modified programmatically, using the WR SET DOC PROPERTY command. |
If you use the constant wr custom link appearance and do not set any link style, the link will appear as current text (it will not be graphicallymaterialised).
linkLabel:
The linkLabel parameter sets the link’s visible text (in View/Values mode).
linkContent:
The linkContent parameter contains the hypertext link value. The nature of this value depends on the type of link:
methodRef:
The methodRef parameter allows you, when the link is a 4D method type, to add a supplementary value to the called method. The method will receive this value in the $3 parameter (Longint type).
You want to insert the URL of your Web site in the 4D Write area:
WR INSERT HYPERLINK(area;wr URL type link;wr default link appearance;"Visit that great site";"http:/www.MySite.com/")
In your 4D Write documents, you want to provide hypertext navigation based on document type links. The following method manages pathnames dynamically, whatever the platform:
$Doc:=Structure file
Doc:=$Doc
While(Position(":";$Doc)#0)
$Doc:=Substring($Doc;1+Position(":";$Doc);Length($Doc))
$Long:=Length($Doc)
End while
Doc:=Substring(Doc;1;Length(Doc)-$Long)
PLATFORM PROPERTIES($Platf;$Syst;$Computer)
If($Platf=Windows)
$name:=Doc+"Documentation"+"/"+"01_Introduction.4W7"
Else
$name:=Doc+"Documentation"+":"+"01_Introduction.4W7"
End if
$title:="See Documentation"
WR INSERT HYPERLINK(Writearea;wr document type link;wr default link appearance;$title;$name)
This example illustrates method type links. In your document, you want the user to be able to enter information, for example his/her name and first name in a particular place. You will insert a hyperlink calling a method named Hyperlink_Method. This method asks the user to enter either her/his name or first name, depending on the value passed in $3. The entered data will then replace the link:
`Hyperlink_Method
C_LONGINT($1;$3)
C_TEXT($2)
Case of
:($3=1)
WR INSERT TEXT($1;Request("Enter your first name"))
:($3=2)
WR INSERT TEXT($1;Request("Enter your last name"))
End case
WR GET SELECTION($1;$deb;$end)
WR SET SELECTION($1;$deb;$end+1)
WR EXECUTE COMMAND($1;wr cmd clear)
Inserting the method type hyperlink in the 4D Write area:
$title:="Click to enter"
$method:="Hyperlink_Method"
WR INSERT TEXT(Area;"Last name: ")
WR INSERT HYPERLINK(Area;wr method type link;wr default link appearance;$title;$method;1)
WR INSERT TEXT(Area;Char(Carriage return)+"First name: ")
WR INSERT HYPERLINK(Area;wr method type link;wr default link appearance;"Click to enter";"Hyperlink_Method";2)
Product: 4D Write
Theme: WR Database Objects
Number:
89430
Created: 4D Write 6.7
4D Write Language ( 4D Write v16)