KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Extracting a Field Help Tip
PRODUCT: 4D | VERSION: 16 | PLATFORM: Mac & Win
Published On: December 19, 2018

A field in a table contains a help tip property as shown below:



The following utility method extracts the help tip programatically:

//---------------------------------------------------------------------------------
// Name: EXTRACT_FIELD_HELP_TIP
// Description: Method will extract the Help Tip property of a Field
//
// Parameters:
// $1 (POINTER) - Pointer to the field
//
// Output:
// $0 (TEXT) - Text of the Help Tip
// --------------------------------------------------------------------------------
C_POINTER($1;$ptrField)
C_LONGINT($pos;$pos2;$pos3)
C_TEXT($0;$vTStruc;$tip;$fieldNum;$search1;$search2;$search3)

$ptrField:=$1

$fieldNum:=String(Field($ptrField))
$search1:="id=\""+$fieldNum+"\""+">"
$search2:=""
$search3:="
"

EXPORT STRUCTURE($vTStruc)

$pos:=Position($search1;$vTStruc) // search for ID
$pos2:=Position($search2;$vTStruc;$pos)
$pos3:=Position($search3;$vTstruc;$pos2)
$tip:=Substring($vTStruc;$pos2+length($search2);$pos3-$pos2-5)

$0:=$tip


Here is an example in using the method:

C_TEXT($tip)

$tip:=EXTRACT_FIELD_TIP (->[People]LastName) // "This is Field Name Field"