WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Determine if All or None Items are Selected in Dialog Itembox

Keywords:    ITEMBOX

Question:

If I have two itemboxes in a dialog and a user is going to pick any number from either, how do I determine if a user picked all or none of the list?

Example, variable list1:

Bob
Fred
George
Example, variable list2:
Frank
Joe
Harry
If I pick nobody in list1 and Joe in list2, the results are the same if I pick everyone in list1 and Joe in list2. How I can tell if a user picks all of the listed items, or none of the items?

Answer:

Here is some test code. If you don't pick anything, then the number of names or fruits returned is 0 and the variables (names and list2 in my case) is blank.
names="Sue Fred Tom Dick Harry"
names=StrReplace(names," ",@tab)

list2="apples bannanas pears watermelons"
list2=strreplace(list2," ",@tab)
DialogFormat=`WWWDLGED,5.0`

DialogCaption=`Test Dialog`
DialogX=5
DialogY=22
DialogWidth=190
DialogHeight=122
DialogNumControls=4

Dialog01=`10,6,78,86,ITEMBOX,names,DEFAULT`
Dialog02=`8,100,64,DEFAULT,PUSHBUTTON,DEFAULT,"OK",1`
Dialog03=`102,100,64,DEFAULT,PUSHBUTTON,DEFAULT,"Cancel",0`
Dialog04=`100,8,64,82,ITEMBOX,list2,DEFAULT`

ButtonPushed=Dialog("Dialog")



xx=ItemCount(names,@tab)
Message("Number of names selected=%xx%",names)

yy=ItemCount(list2,@tab)
Message("Number of fruits selected=%yy%",list2)

Article ID:   W12832
Filename:   Determine if All or None of Items are Selected.txt
File Created: 1999:04:15:16:49:56
Last Updated: 1999:04:15:16:49:56