🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #400

listbox problem.

#400
From: Neil
Date: Tue, 21 Jul 1992 13:02
50 lines
1756 bytes
the following code for some reason only pulls the first selected item from the listbox,and 
I cannot figure out why it does not do all of them...

Any suggestions are appreciated.
 Thank you.

Here is the code:

void Move()
{	int selNum;
	int index;
	char text[256]; 
	PSZ selection, 
		newp,
		oldp;
	char newst[256];
	char oldst[256];

	text[0]=NULL;
	newst[0]=NULL;
	oldst[0]=NULL;
	selection = (PSZ) text;

	selNum = SHORT1FROMMR( WinSendMsg(hwndList,
				LM_QUERYSELECTION,
				MPFROMSHORT( LIT_FIRST ),
				NULL ));

	while  ( selNum != LIT_NONE)
	{	WinSendMsg(hwndList,
			LM_QUERYITEMTEXT,
			MPFROM2SHORT( selNum,sizeof(text)),
			MPFROMP( selection ));	
	 	strcat( newst, p2);
		if (newst[strlen(newst) -1] != '\\' )
			strcat( newst, "\\" );
		strcat( newst, selection);
		strcpy( oldst,  p1);
		if (oldst[strlen(oldst) -1] != '\\' )
			strcat( oldst, "\\" );
		strcat( oldst,  selection);
		newp = (PSZ) newst;
		oldp = (PSZ) oldst;
		DosMove(oldp, newp, 0L);
		selNum=SHORT1FROMMR(WinSendMsg(hwndList,
                                            LM_QUERYSELECTION,
                                            MPFROMSHORT(selNum),
                                            0L));
	};
};
Technical Details
Message-ID: <76293@ut-emx.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu!fly

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu!fly
From: fly@ccwf.cc.utexas.edu (Neil)
Newsgroups: comp.os.os2.programmer
Subject: listbox problem.
Message-ID: <76293@ut-emx.uucp>
Date: 21 Jul 92 13:02:35 GMT
Sender: root@ut-emx.uucp
Reply-To: fly@ccwf.cc.utexas.edu (Neil)
Organization: The University of Texas at Austin, Austin TX
 I am having trouble pulling all of the selected items from a multiple selection listbox.
Lines: 50
Originator: fly@thumper.cc.utexas.edu