Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link ABC: Locators for additional sort fields 1999-04-02 -- Jim Kane Newsgroups: comp.lang.clarion
> The quaestion is that how can I assign a locator on this 'virtual
> key' - if the view sorted in that order it means that could be a locator.
> Any ideas?
Here is an example of adding a locator for an additional sort field
(acc:ar_id) that is the 2nd field in the order (one keyfield then the
additional sort field):
!data
MyLoc IncrementalLocatorClass
!Thiswindow.init after Brw1.addsortorder for the order to use the locator
for
BRW1.AddSortOrder(BRW1::Sort0:StepClass,job:SCHEDX)
BRW1.AddRange(job:DPT_ID,Loc:dpt_id)
BRW1.AppendOrder('acc:ar_id')
BRW1.SetFilter('(JOB:SCH_DATE=LOC:DATE)')
BRW1.AddField(acc:AR_ID,BRW1.Q.acc:AR_ID)
BRW1.ADDLOCATOR(MYLOC) !!!
MYLOC.INIT(?LOC:ar_id,ACC:AR_ID,1,BRW1)!!!
BRW1.GetFreeElementName PROCEDURE()
ReturnValue ANY
CODE
rETURNVALUE &= ACC:AR_ID !!!
RETURN(RETURNVALUE) !!!
ReturnValue = PARENT.GetFreeElementName()
BRW1.GetFreeElementPosition PROCEDURE()
ReturnValue BYTE,AUTO
CODE
RETURN(2) !!!additional sort field is 2nd in prop:order
ReturnValue = PARENT.GetFreeElementPosition()
BRW1.SetSort PROCEDURE(BYTE OrderNumber)
ReturnValue BYTE,AUTO
CODE
ReturnValue = PARENT.SetSort(OrderNumber)
If ~firsttime1# and ordernumber=1
self.sort.freeelement &=acc:ar_id
firsttime1#=1
put(self.sort)
end
RETURN ReturnValue
HTH,
---
Jim Kane
Today is November 21, 2024, 6:56 am This article has been viewed 35352 times. Google search has resulted in 10 hits on this article since January 25, 2004.
|
|