Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clarion - Find FEQ from LABEL using DBG.GetFEQDescr
WindowManagerEst.FindFEQFromLabel PROCEDURE(STRING Label, SIGNED xLowFEQ=-MAX:FEQ, SIGNED xHiFEQ=MAX:FEQ)
SearchFor &STRING
CurrFEQ FEQ
CREATE:_ComboButton EQUATE(CREATE:combo + 0100H) !see NG: Softvelocity.clarion.documentation Thread:"What is {prop:type}=271" Sept-18-2006
CODE
DO SetSearchFor
! ASSERT(0,eqDBG&'FindFEQFromLabel SearchFor['& SearchFor &']')
LOOP
CurrFEQ=SELF.MyWindow{PROP:NextField, CurrFEQ}
IF ~CurrFEQ
BREAK
END
IF ~INRANGE( CurrFEQ, xLowFEQ, xHiFEQ)
CYCLE
END
CASE CurrFEQ{PROP:Type}
OF CREATE:sublist
OROF CREATE:_ComboButton ; !avoid ELSE <--- MG Policy
ELSE
! ASSERT(0,eqDBG&' CurrFEQ['& FORMAT(CurrFEQ,@N_5) &']=['& dbg.GetFEQDescr(CurrFEQ) &']')
IF SearchFor = dbg.GetFEQDescr(CurrFEQ)
! note: dbg is an instance of debuger found
! https://github.com/MarkGoldberg/ClarionCommunity/blob/master/CW/Shared/Src/debuger.clw
BREAK
END
END
END
DISPOSE(SearchFor)
RETURN CurrFEQ
SetSearchFor ROUTINE
DATA
NeededSize LONG,AUTO
Leading CSTRING(2)
CODE
NeededSize = LEN(CLIP(Label))
IF SUB(Label, 1,1) <> '?'
Leading ='?'
NeededSize += 1
END
SearchFor &= NEW STRING(NeededSize)
SearchFor = Leading & UPPER(CLIP(Label))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.