` Printed Icetips Article

Icetips Article



Par2: Locate on non-indexed field
2001-08-23 -- Dennis Evans
 
Add the locator normally,
use a local field for the entry control,
use the override default control to set the control to the local variable,
in the ThisWindow.Init method after the locator init call

LocatorName.Destruct()
LocatorName.FreeElement &= Field from the column

in the GetFreeElementPosition method, after the parent call

ReturnValue += 1

If you have more than one sort order on the browse then you will need to
make sure the code in the GetFreeElementPosition is used on the correct
sort.

-----
  You will have to use the embed editor not the embed tree.
In the ThisWIndow.Init method a little better than half way down you will
see code something like,

  Brw1.Init(...
  Brw1.AddSortOrder(...
  Brow1.AddLocator(...
  Brw1::Locator.Init(...
  and so on

  in the emebd point following all that alter the FreeElement of the
locator.   With more that one sort order you will need to adjust to the
correct sort,  the first sort order/tab displayed is the last one added.
The second sort order/tab is the first.

  Brw1.SetSort(x)         x = 1 or 2
  LocatorName.Destruc()
  LocatorName.FreeElement &= xyz
  Brw1.SetSort(2)

Assumes two sort orders, note if you are doing this on the first sort order
since it is the last one added it will be the active one so the SetSort
calls are not required.

> ---How do I do this. I have two tabs and each is sorted on a >different
non-indexed column.

   if choice(?currenttab) = x
      ReturnValue + =1
   end
  or for more than one tab/sort order

   case choice(?CurrentTab)
     of 1
      of 2
     ...



Printed April 29, 2024, 2:42 am
This article has been viewed/printed 35110 times.