From: Bill Tillick on
Thanks all, I am sure my solution is somewhere in those varied
suggestions.
Will particularly look at bCheckColumn as suggested by Geoff, because
it sounds most like what I need.

I also have #MULTIPLE to look into, as that may also solve the
problem. I do not have a requirement to retain the checkbox value.

I started out trying to solve my problem in bB1.4 but now see that bB3
offers more possibilities.

Thanks again, this is a great forum.
Bill
From: richard.townsendrose on
Bill

to add a check column ...

oCol:=bCheckColumn{SELF:oDCSvyList, SELF:oAD, #SELECT}
oCol:HyperLabel:Caption:='Select'
oCol:Width:=40
SELF:oDCSvyList:AddColumn(oCol)
SELF:oDCSvyList:OpenColumn(oCol,1)

in celledit() method you can control if its settable ... and at the
bottom we show the use the number selected ..

METHOD CellEdit(oEvent) CLASS Svy_Alloc
LOCAL oColumn AS bDataColumn
LOCAL oCol AS bCheckColumn

IF
oEvent:EditMode=BEDIT_CREATE
IF SELF:lPrinting
RETURN FALSE
ENDIF
oColumn:=oEvent:Control:GetOpenColumn(oEvent:EditCell:Column)
IF oColumn:FieldSym=#SELECT
IF SELF:lWorks
IF ! SELF:WorksIssd(SELF:oAD:FIELDGET(#ASSETREF)) == NULL_DATE
RETURN FALSE
ENDIF
ELSE
IF ! Empty(LookupName(SELF:oAD:FIELDGET(#ASSETREF), #HANDLER))
RETURN FALSE
ENDIF
ENDIF
ENDIF
ENDIF

oCol:=SELF:oDCSvyList:GetColumn(#SELECT)
SELF:oDCNoSel:Value:=NTrim(oCol:CheckedCount)

RETURN TRUE

and then you need to get hold of the records that have been checked at
some stage to actually process them ...

METHOD GetCheckedRecNos CLASS Svy_Alloc
LOCAL aRecNos:={} AS ARRAY
LOCAL oCol AS bCheckColumn
LOCAL auBlock AS ARRAY
LOCAL iBlockCount AS DWORD
LOCAL iBlock AS DWORD
LOCAL iRecStart AS INT
LOCAL iRecEnd AS INT
LOCAL iRecNo AS INT

oCol:=SELF:oDCSvyList:GetColumn(#Select)

auBlock := oCol:RecordList
iBlockCount := ALen(auBlock)

FOR iBlock:=1 UPTO iBlockCount
iRecStart := auBlock[iBlock, BCCB_STARTRECNO]
iRecEnd := auBlock[iBlock, BCCB_ENDRECNO]
FOR iRecNo := iRecStart UPTO iRecEnd
AAdd(aRecNos, iRecNo)
NEXT

NEXT

RETURN aRecNos

hope that helps

richard