Category : Files from Magazines
Archive   : VOL11N12.ZIP
Filename : SLIST.SCT

 
Output of file : SLIST.SCT contained in archive : VOL11N12.ZIP
! wpicklist "~cTitle" Slist_SHOW()#itsexpression ~
#SECTION 1
PARAMETER aAvail, aSelected, cTitle
EXTERNAL ARRAY aSelected, aAvail
IF EMPTY(cTitle) && Supply default title
cTitle="Make Your Selections and Place Them In Any Order"
ENDIF
#SECTION 2
nBarctr = 0 && BAR index counter, never decrements
&& as the popup is relative
nSelected = 0 && counter for the Selected array
nAvail = ALEN(aAvail) && number of items in the Available array
nAvailpos = 1 && initial/current position of bar in Available list
nSelpos = 0 && initial/current position of bar in Selected list
cOKCancel = "" && return value of OK and Cancel buttons
DEFINE POPUP pSelected RELATIVE MOVER SCROLL MARGIN MARK ""

Þ* Post-READ Cleanup code
nSelected = 0
IF cOkcancel = "OK"
*
* Build Selected array with prompts from the Selected box
*
nSelected = CNTBAR('pSelected')
FOR n = 1 TO nSelected
* GETBAR() returns the next bar number, PRMBAR() its prompt
aSelected(n) = PRMBAR('pSelected',GETBAR('pSelected',n))
ENDFOR
ENDIF
RETURN (nSelected) && Number of items selected
*
* FUNCTION Slist_SHOW - Called to enable or disable controls
*
FUNCTION Slist_SHOW
IF nSelected > 0 && If Selected items exist,
SHOW GET nSelpos ENABLE && enable the Selected listbox
SHOW GET cOkcancel,1 ENABLE
ELSE
SHOW GET nSelpos DISABLE && Otherwise disable it
SHOW GET cOkcancel,1 DISABLE
ENDIF
IF nAvail > 0 && If Available items exist,
SHOW GET nAvailpos ENABLE && enable the Available listbox
ELSE
SHOW GET nAvailpos DISABLE && Otherwise disable it
ENDIF
RETURN .T.
*
* FUNCTION fnAdd - Add an item to the Selected list
*
FUNCTION fnAdd && Add an item to Selected list
PARAMETER nPicked
nSelected = nSelected + 1 && Update selected array counter
nSelpos = nSelected && Set current pos of bar in selected
&& to the last item in list
nBarctr = nBarctr + 1 && Relative, it never decrements
* Define a new bar with prompt
* from Available list
DEFINE BAR (nBarctr) OF pSelected PROMPT aAvail(nPicked)
IF nPicked = nAvail && If item picked is the last one
nAvailpos = nAvail - 1 && Make (last - one) the current item
ENDIF
=ADEL(aAvail, nPicked) && Delete current item from Available
nAvail = nAvail - 1 && Decrement the Available counter
IF nAvail = 0 && If there is none left
_curobj = 2 && put cursor on the target
ENDIF
SHOW GETS && Update screen
RETURN .F.
*
* FUNCTION fnRemove - Remove an item from the Selected list
*
FUNCTION fnRemove && Remove item from Selected list
PARAMETER nPicked
nSelected = nSelected - 1 && Decrement counter
nAvailpos = MAX(nAvailpos, 1) && Get current position
nAvail = nAvail + 1 && Increment it
=AINS(aAvail, nAvailpos) && Make space and put it back
aAvail(nAvailpos) = PRMBAR('pSelected',GETBAR('pSelected',nPicked))
=ASORT(aAvail, 1, nAvail) && Sort the array
nSelpos = MIN(nSelpos, nSelected) && Update the Selected position
RELEASE BAR (GETBAR('pSelected',nPicked)) OF pSelected
SHOW GETS
RETURN .F.
 nAvailposaAvailfnAdd(nAvailpos)nAvail"@&N"nSelpos pSelectedfnRemove(nSelpos)z2pk_tc"@&N" "Available"
"Selected" cOKCancel"@*VT \!\

  3 Responses to “Category : Files from Magazines
Archive   : VOL11N12.ZIP
Filename : SLIST.SCT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/