Dear Anssi and Rajeev
List boxes DO have calling clauses. On your first Multi List control
have a calling List1Used as below
Define LIST_ONE 300
Define LIST_TWO 301
Define MY_BUUTON 302
global gsStringList1(1) as string
global gsStringList2(1) as string
..code
..
..
redim gsStringList1(4)
redim gsStringList2(7)
Dialog
...
...
Control MultiListBox
ID LIST_ONE
Calling List1Ised
title from variable gsStringList1
Control MultiListBox
ID LIST_TWO
title from variable gsStringList2
Control Button
ID MY_BUTTON
calling ReinventTheWheel
...
more code
...
Sub List1Used
Dim lnValue as integer
lnValue = ReadControlValue(LIST_ONE)
' lengthen 2nd list
if lnValue = 3 then
redim gsStringList2(8)
gsStringList2(8)="add another 1"
Alter Control LIST_TWO title from variable gsStringList2
'disable command button
Alter Control MY_BUTTON disable
end if
' shorten 2nd list
if lnValue = 2 then
redim gsStringList2(Ubound(gsStringList2)-1)
Alter Control LIST_TWO title from variable gsStringList2
' enable command button
Alter Control MY_BUTTON enable
end if
End Sub
The above is an example of the sort of code you need. You will need to
remember to redim both arrays ( for listboxes/multilistboxes/popupmenus
) if you are adding to or deleting from the list otherwise you will get
empty lines.
If you cannot understand what I mean ( its a bit late! ) send me an e-
mail direct and I'll give you some verbose code.
The EditText Control is the only control that does not have a calling
Clause in MapBasic.
Regards
Bob
message <004101bee48f$db6f8e10$[EMAIL PROTECTED]>, Anssi
Joutsiniemi <[EMAIL PROTECTED]> writes
>Rajeev,
>
>ListBoxes doesn't have Calling clause so you need user activity (to push
>button, double click or so) to move selected items from one listbox to the
>other.
>
>Try compiling following code.
>
>Regards,
> Anssi
>
>'*********************************
>Declare Sub Main
>Declare Sub Main_chk
>
>Global sValue(10), sNew() As String
>Sub Main
>sValue(1) = "one"
>sValue(2) = "two"
>sValue(3) = "three"
>sValue(4) = "four"
>sValue(5) = "five"
>sValue(6) = "six"
>sValue(7) = "seven"
>sValue(8) = "eight"
>sValue(9) = "nine"
>sValue(10) = "ten"
>
>Dialog
>Title " "
>Control MultilistBox ID 20 Title From Variable sValue
>Control MultiListBox ID 30 Title From Variable sNew
>Control Button ID 10 Title "Move" Calling Main_chk Width 80
>
>End Sub
>Sub Main_chk
>Dim i, j As Integer
>
>Do Case TriggerControl()
>Case 10
>ReDim sNew(0)
>For i = 1 To UBound(sValue)
>j = ReadControlValue(20)
>
>If j <> 0 Then
>ReDim sNew(i)
>sNew(i) = sValue(j)
>Else
>Exit For
>End If
>
>Next
>Alter Control 30 Title From Variable sNew
>End Case
>End Sub
>'***********************************
>-----Original Message-----
>From: Rajeev Saraf <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>Date: 11. elokuuta 1999 20:05
>Subject: MI MB: can one control be made dependent on the output of another
>control in db
>
>
>>Hi guys,
>>say we have two multi-list controls in a dialog box. is it possible to
>>populate the second multi-list based on the selection from the first
>>multi-list - sort of make second multi-list dependent on the output of
>first
>>multi-list control?
>>
>>Any suggestion?
>>--
>>Rajeev saraf
>>lepton software
>>1-a/2 jia sarai
>>near iit, hauz khas
>>new delhi 16 INDIA
>>
>>
>>______________________________________________________
>>Get Your Private, Free Email at http://www.hotmail.com
>>----------------------------------------------------------------------
>>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
--
Bob Young
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]