KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Finding if you are "In Selection"
PRODUCT: 4D | VERSION: 11.5 | PLATFORM: Mac & Win
Published On: December 11, 2009

Here is a code snippet that can be used to find if you are in the current selection:

` --[HEADERSTART]-------------------------------------
` Description:
` This method is used to find out if you are in the current selection
`
` Parameters:
` $1 = Pointer to the table
`
` Return Value:
` $0 = Boolean; true if in selection, false if not in selection
` --[HEADEREND]---------------------------------------

C_POINTER($1)
C_BOOLEAN($0)
If ((Before selection($1->)) | (End selection($1->)))
   $0:=False
Else
   $0:=True
End if





Example 1:

While(In Selection(->[MyTable]))
   ` Do Something with the record
   Next Record([MyTable])
End While





Example 2:

While(In Selection(->[MyTable]))
   ` Do Something with the record
   Previous Record([MyTable])
End While