In Concomp create a test form with One User Defined Variable ListBox based ?
dummy or formtable or whatever your edit table.

In the BeforeStart EEP:

Set var eInvNum text = null
ret

In the OnAfterStart EEP:

CLS
SET SELMARGIN 1
SET VAR ebl = (CHAR(160))
SET LINES 0
SET HEADINGS OFF
OUTPUT dupinv.lff
SELECT +
(LJS((CTXT(transid)),8))=8, .ebl=1,(LJS((CTXT(transdate)),10))=10, .ebl=1, +
(RJS((CTXT(netamount)),9))=9 +
FROM transmaster
--SELECT +
--(LJS(InvNum,20))=20, .eBL=1, (LJS(CTXT(ImpDOIN),14))=14, .eBL=1, +
--(LJS(CTXT(ExistDOIN),14))=14 +
--FROM InDupPik +
--WHERE ImportID = .fImportID +
--ORDER BY InvNum
OUTPUT SCREEN
PROPERTY DupPikListBox listitemsclear 'TRUE'
PROPERTY DupPikListBox load_from_file 'DupInv.lff'
SET HEADINGS ON
SET LINES 22
RETURN


Set the ComponentID of the ListBox to DupPikListBox
set the variable to eInvNum

Set the ListBox OnClick EEP to:

Set var eInvNum text = (Strim((ssub(.eInvNum,-1))))
pause 2 using .einvnum
return


The Pause will have the TransID in it.  From this you should be able to
construct yours...The variabel eInvNum has to be initialized in the
onBeforeStart EEP for this to be successful.

Also David, if you want to return a value you don't want to display, put the
value in the Far right of the string in the Listbox out of display range and
use an SGET to retrieve that value....


----- Original Message ----- 
From: "David M. Blocker" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 12:43 PM
Subject: [RBG7-L] - Re: ListBox Properties


> Mike and others
>
> THanks for all the listings about sample list boxes, etc.
>
> But ya gotta walk before you can run and I'm clearly not getting something.
>
> My form has a variable user defined list box
>
> An on after start eep populates the list box from a SELECT:
>
> CLS
> SET SELMARGIN 1
> SET VAR eBL = (CHAR(160))
> SET HEADINGS OFF
> OUTPUT DupInv.lff
> SELECT +
> (LJS(InvNum,20))=20, .eBL=1, (LJS(CTXT(ImpDOIN),14))=14, .eBL=1, +
> (LJS(CTXT(ExistDOIN),14))=14 +
> FROM InDupPik +
> WHERE ImportID = .fImportID +
> ORDER BY InvNum
> OUTPUT SCREEN
> PROPERTY DupPikListBox listitemsclear 'TRUE'
> PROPERTY DupPikListBox load_from_file 'DupInv.lff'
> SET HEADINGS ON
>
> OK, now  I don't understand what's next looking at the samples.  I want the
> user to be able to click on ONE item in the list (yes, just one), have that
> item highlighted, and have the code return the unique ID (column InvNum) of
> the item selected into variable eInvNum.
>
> With just the above in place, I can't even click on an item and have it
> highlighted!  Nice list, but no clicking has no result
>
> The variable assigned to the list box is eInvInfo
>
> What do I do?  An after click eep?
>
> Please treat me as in the middle of a big DUHHH and clarify what to do - and
> if you use any of the new property or getproperty commands, please specify
> what they do. I'm still confused!
>
> David Blocker
> [EMAIL PROTECTED]
> 781-784-1919
> Fax: 781-784-1860
> Cell: 339-206-0261
> ----- Original Message -----
> From: "MikeB" <[EMAIL PROTECTED]>
> To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 01, 2004 6:37 PM
> Subject: [RBG7-L] - Re: ListBox Properties
>
>
> >
> > >Is there a property command that will move entries up and down in a
> > >listbox?
> >
> > copy this code, click on the demo form and select paste, then run the form
> and
> > test it.  It moves 1 or more items up 1 in the list...
> >
> > object EnhancedSpeedButton2: TEnhancedSpeedButton
> >   Left = 220
> >   Top = 310
> >   Width = 77
> >   Height = 42
> >   Caption = 'Move 1 Selected Item Up the List'
> >   HotTrackFont.Charset = DEFAULT_CHARSET
> >   HotTrackFont.Color = clWindowText
> >   HotTrackFont.Height = -11
> >   HotTrackFont.Name = 'MS Sans Serif'
> >   HotTrackFont.Style = [fsUnderline]
> >   NumGlyphs = 1
> >   WordWrap = True
> >   EEPNum = -1
> >   CustomEEP.Strings = (
> >     'SET VAR vcnt = NULL'
> >     'SET VAR vtext TEXT = NULL'
> >     'GetProperty lbcompany listcount '#39'vcnt'#39
> >     'SET VAR vindex TEXT = '#39'0'#39
> >     'SET VAR vtmpidx TEXT = '#39'0'#39
> >     'WHILE (INT(.vindex)) <> (INT(.vcnt)) THEN'
> >     '  SET VAR vchk = (INT(.vindex))'
> >     '  PROPERTY lbcompany checkindex .vchk'
> >     '  GETPROPERTY lbcompany selectedstate '#39'vsel'#39
> >     '  IF vsel = '#39'TRUE'#39' THEN'
> >     '    IF vchk <> 0 THEN'
> >     '      PROPERTY lbcompany unselect .vchk'
> >     '      SET VAR vtmpidx = (ctxt(((INT(.vindex)) - 1)))'
> >     '      -- get the value of the current'
> >     '      PROPERTY lbcompany itemindex .vchk'
> >     '      GetProperty lbcompany selection '#39'vItem'#39
> >     '      -- get the value of the item preceeding'
> >     '      PROPERTY lbcompany itemindex .vtmpidx'
> >     '      GetProperty lbcompany selection '#39'vText'#39
> >     '      -- swap the values'
> >     '      PROPERTY lbcompany itemindex .vchk'
> >     '      PROPERTY lbcompany selection .vtext'
> >     '      PROPERTY lbcompany itemindex .vtmpidx'
> >     '      PROPERTY lbcompany selection .vitem'
> >     '    ENDIF'
> >     '  ENDIF'
> >     '  SET VAR vindex = (CTXT((INT(.vindex)) + 1 ))'
> >     'ENDWHILE'
> >     'Getproperty lbcompany listcount '#39'vcnt'#39
> >     'SET VAR vtext  = ('#39'ListBox "A" has'#39' & .vcnt &
> '#39'Items'#39')'
> >     'PROPERTY stxlb1 CAPTION .vtext'
> >     ''
> >     'Getproperty lbother listcount '#39'vcnt'#39
> >     'SET VAR vtext  = ('#39'ListBox "A" has'#39' & .vcnt &
> '#39'Items'#39')'
> >     'PROPERTY stxlb2 CAPTION .vtext'
> >     'RETURN')
> > end
> >
> >
>

Reply via email to