Hi Dorian, thank you to reply.
Let say you have a product for:
Client (Male or Female from user selection) - Age (Multiple selection) - SmokinStatus - Amount (Multiple selection)
I want to show for in list
Scenario(x) Client Age(x) SmokingStatus Amount(x)
In the exemple the selection is 3 X Amount and Age X 7 = 21 scenarios
Scénario 1....Homme...30....50000
Scénario 2....Homme...30....100000
Scénario 3....Homme...30....250000
Scénario 4....Homme...40....50000
Scénario 5....Homme...40....100000
Scénario 6....Homme...40....250000
Scénario 7....Homme...50....50000
Scénario 8....Homme...50....100000
Scénario 9....Homme...50....250000
...
...
Scénario 19....Homme...90....50000
Scénario 20....Homme...90....100000
Scénario 21....Homme...90....250000
Here's the code:
Code: Select all
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
//List of values to display in Combo Box separated by carriage return / line feed
Let>CBList_prod_par=Vie entière payable 10 ans - Patrimoine bonifié%crlf%Vie entière payable 10 ans - Croissance accélérée%crlf%Vie entière payable 20 ans - Patrimoine bonifié%crlf%Vie entière payable 20 ans - Croissance accélérée%crlf%Vie entière payable à 100 ans - Patrimoine bonifié%crlf%Vie entière payable à 100 ans - Croissance accélérée%crlf%
Let>LW10_nom=Vie entière garantie payable 10 ans
Let>LW15_nom=Vie entière garantie payable 15 ans
Let>LW20_nom=Vie entière garantie payable 20 ans
Let>LW65_nom=Vie entière garantie payable à 65 ans
Let>LW00_nom=Vie entière garantie payable à 100 ans
Let>LT00_nom=Temporaire à 100 ans
Let>LT10_nom=Temporaire 10 ans
Let>LT20_nom=Temporaire 20 ans
Let>LT30_nom=Temporaire 30 ans
Let>LT65_nom=Temporaire 65 ans
Let>MGT10_nom=Priorité santé - temporaire 10 ans
Let>MGT20_nom=Priorité santé - temporaire 20 ans
Let>MGT65_nom=Priorité santé - temporaire 65 ans
Let>MGT75_nom=Priorité santé - temporaire 75 ans
Let>MGT110_nom=Priorité santé - payable 10 ans
Let>MGT120_nom=Priorité santé - payable 20 ans
Let>MGTE_nom=Priorité santé - enfant, payable 20 ans
Let>MGT100_nom=Priorité santé - payable à 100 ans
Let>CPPT75_nom=Priorité santé - affaires, temporaire à 75 ans
Let>CPPT100_nom=Priorité santé - affaires, temporaire à 100 ans
Let>CBList_prod_vie_mg=%LW10_nom%%crlf%%LW15_nom%%crlf%%LW20_nom%%crlf%%LW65_nom%%crlf%%LW00_nom%%crlf%%LT00_nom%%crlf%%LT10_nom%%crlf%%LT20_nom%%crlf%%LT30_nom%%crlf%%LT65_nom%%crlf%%MGT10_nom%%crlf%%MGT20_nom%%crlf%%MGT20_nom%%crlf%%MGT65_nom%%crlf%%MGT75_nom%%crlf%%MGT110_nom%%crlf%%MGT120_nom%%crlf%%MGTE_nom%%crlf%%MGT100_nom%%crlf%%CPPT75_nom%%crlf%%CPPT100_nom%%crlf%
Let>CBList_sex=Homme%crlf%Femme%crlf%
Let>CBList_taux=Privilégié / Non-fumeur%crlf%Régulier / Fumeur%crlf%
Let>CBList_plateforme=Assurance vie / Maladies graves%crlf%Assurance vie avec participation%crlf%Assurance vie universelle%crlf%Assurance invalidité%crlf%
Let>CBList_cie=Desjardins%crlf%Canada Vie%crlf%Empire%crlf%Equitable%crlf%IA%crlf%Manuvie%crlf%RBC%crlf%SunLife%crlf%
//Combo Box property "Text" is set to
//the initial Combo Box display text
Dialog>Dialog1
object Dialog1: TForm
Left = 843
Top = 157
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Hypoth'#232'ses des sc'#233'narios'
ClientHeight = 492
ClientWidth = 861
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poMainFormCenter
ShowHint = True
OnTaskBar = False
PixelsPerInch = 144
TextHeight = 20
object lbl_prest_1: TLabel
Left = 400
Top = 40
Width = 85
Height = 20
Caption = 'Prestation 1'
end
object lbl_prest_2: TLabel
Left = 400
Top = 80
Width = 85
Height = 20
Caption = 'Prestation 2'
end
object lbl_prest_3: TLabel
Left = 400
Top = 120
Width = 85
Height = 20
Caption = 'Prestation 3'
end
object lbl_prest_4: TLabel
Left = 400
Top = 160
Width = 85
Height = 20
Caption = 'Prestation 4'
end
object lbl_prest_5: TLabel
Left = 400
Top = 200
Width = 85
Height = 20
Caption = 'Prestation 5'
end
object lbl_prest_6: TLabel
Left = 400
Top = 240
Width = 85
Height = 20
Caption = 'Prestation 6'
end
object lbl_prest_7: TLabel
Left = 400
Top = 280
Width = 85
Height = 20
Caption = 'Prestation 7'
end
object lbl_prest_8: TLabel
Left = 400
Top = 320
Width = 85
Height = 20
Caption = 'Prestation 8'
end
object lbl_prest_9: TLabel
Left = 400
Top = 352
Width = 85
Height = 20
Caption = 'Prestation 9'
end
object lbl_prest_10: TLabel
Left = 400
Top = 392
Width = 94
Height = 20
Caption = 'Prestation 10'
end
object Label1: TLabel
Left = 632
Top = 40
Width = 42
Height = 20
Caption = 'Age 1'
end
object Label2: TLabel
Left = 632
Top = 80
Width = 42
Height = 20
Caption = 'Age 2'
end
object Label3: TLabel
Left = 632
Top = 120
Width = 42
Height = 20
Caption = 'Age 3'
end
object Label4: TLabel
Left = 632
Top = 160
Width = 42
Height = 20
Caption = 'Age 4'
end
object Label5: TLabel
Left = 632
Top = 200
Width = 42
Height = 20
Caption = 'Age 5'
end
object Label6: TLabel
Left = 632
Top = 240
Width = 42
Height = 20
Caption = 'Age 6'
end
object Label7: TLabel
Left = 632
Top = 280
Width = 42
Height = 20
Caption = 'Age 7'
end
object Label8: TLabel
Left = 632
Top = 320
Width = 42
Height = 20
Caption = 'Age 8'
end
object Label9: TLabel
Left = 632
Top = 352
Width = 42
Height = 20
Caption = 'Age 9'
end
object Label10: TLabel
Left = 632
Top = 392
Width = 51
Height = 20
Caption = 'Age 10'
end
object MSComboBox1: tMSComboBox
Left = 15
Top = 74
Width = 370
Height = 28
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
TabOrder = 1
Text = 'Choisir le produit vie / mg'
end
object MSButton1: tMSButton
Left = 398
Top = 432
Width = 115
Height = 38
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
Caption = 'Ok'
TabOrder = 27
DoBrowse = False
BrowseStyle = fbOpen
end
object edt_prest_1: TEdit
Left = 502
Top = 35
Width = 121
Height = 28
TabOrder = 5
end
object edt_prest_2: TEdit
Left = 502
Top = 74
Width = 121
Height = 28
TabOrder = 6
end
object edt_prest_3: TEdit
Left = 502
Top = 116
Width = 121
Height = 28
TabOrder = 7
end
object edt_prest_4: TEdit
Left = 502
Top = 155
Width = 121
Height = 28
TabOrder = 8
end
object edt_prest_5: TEdit
Left = 502
Top = 194
Width = 121
Height = 28
TabOrder = 9
end
object edt_prest_6: TEdit
Left = 502
Top = 237
Width = 121
Height = 28
TabOrder = 10
end
object edt_prest_7: TEdit
Left = 502
Top = 278
Width = 121
Height = 28
TabOrder = 11
end
object edt_prest_8: TEdit
Left = 502
Top = 315
Width = 121
Height = 28
TabOrder = 12
end
object edt_prest_9: TEdit
Left = 502
Top = 350
Width = 121
Height = 28
TabOrder = 13
end
object edt_prest_10: TEdit
Left = 502
Top = 387
Width = 121
Height = 28
TabOrder = 14
end
object MSComboBox3: tMSComboBox
Left = 16
Top = 156
Width = 369
Height = 28
TabOrder = 3
Text = 'Choisir le taux'
end
object MSComboBox4: tMSComboBox
Left = 14
Top = 37
Width = 371
Height = 28
TabOrder = 0
Text = 'Choisir la plateforme'
end
object MSComboBox5: tMSComboBox
Left = 10
Top = 195
Width = 375
Height = 28
TabOrder = 4
Text = 'Choisir la compagnie'
end
object MSListBox1: tMSListBox
Left = 9
Top = 240
Width = 376
Height = 233
ItemHeight = 20
TabOrder = 15
SelectedIndex = -1
end
object edtAge1: TEdit
Left = 690
Top = 34
Width = 50
Height = 28
TabOrder = 15
end
object edtAge2: TEdit
Left = 690
Top = 73
Width = 50
Height = 28
TabOrder = 16
end
object edtAge3: TEdit
Left = 690
Top = 117
Width = 50
Height = 28
TabOrder = 17
end
object edtAge4: TEdit
Left = 690
Top = 155
Width = 50
Height = 28
TabOrder = 18
end
object edtAge5: TEdit
Left = 690
Top = 194
Width = 50
Height = 28
TabOrder = 19
end
object edtAge6: TEdit
Left = 690
Top = 237
Width = 50
Height = 28
TabOrder = 20
end
object edtAge7: TEdit
Left = 690
Top = 279
Width = 50
Height = 28
TabOrder = 21
end
object edtAge8: TEdit
Left = 690
Top = 315
Width = 50
Height = 28
TabOrder = 22
end
object edtAge9: TEdit
Left = 690
Top = 350
Width = 50
Height = 28
TabOrder = 23
end
object edtAge10: TEdit
Left = 690
Top = 387
Width = 50
Height = 28
TabOrder = 24
end
object chkSexMale: TCheckBox
Left = 755
Top = 34
Width = 97
Height = 26
Caption = 'Homme'
TabOrder = 25
end
object chkSexFemme: TCheckBox
Left = 755
Top = 73
Width = 97
Height = 28
Caption = 'Femme'
TabOrder = 26
end
object MSComboBox2: tMSComboBox
Left = 16
Top = 113
Width = 369
Height = 28
TabOrder = 2
Text = 'Choisir le produit vie par'
end
end
EndDialog>Dialog1
//If the Dialog is closed quit the script
AddDialogHandler>Dialog1,,Onclose,Quit
//If the "Ok" button is picked, procees the combo box selection
AddDialogHandler>Dialog1,msButton1,Onclick,Process
//Set the combo box list text
SetDialogProperty>Dialog1,MSComboBox2,listtext,CBlist_prod_par
SetDialogProperty>Dialog1,mscombobox1,listtext,CBList_prod_vie_mg
SetDialogProperty>Dialog1,mscombobox3,listtext,CBlist_taux
SetDialogProperty>Dialog1,mscombobox4,listtext,CBlist_plateforme
SetDialogProperty>Dialog1,mscombobox5,listtext,CBlist_cie
//Subroutine to end script
SRT>Quit
Exit>0
END>Quit
//Display the dialog
Show>dialog1,res1
//Subroutine to Process combo box selection
SRT>Process
//GetDialogProperty>Dialog1,msComboBox1,text,nom_produit_par
//GetDialogProperty>Dialog1,msComboBox1,text,nom_produit_vie_mg
GetDialogProperty>Dialog1,chkSexMale,Checked,chkMale
GetDialogProperty>Dialog1,chkSexFemme,Checked,chkFemale
GetDialogProperty>Dialog1,edtAge1,text,code_age1
GetDialogProperty>Dialog1,edtAge2,text,code_age2
GetDialogProperty>Dialog1,edtAge3,text,code_age3
GetDialogProperty>Dialog1,edtAge4,text,code_age4
GetDialogProperty>Dialog1,edtAge5,text,code_age5
GetDialogProperty>Dialog1,edtAge6,text,code_age6
GetDialogProperty>Dialog1,edtAge7,text,code_age7
GetDialogProperty>Dialog1,edtAge8,text,code_age8
GetDialogProperty>Dialog1,edtAge9,text,code_age9
GetDialogProperty>Dialog1,edtAge10,text,code_age10
GetDialogProperty>Dialog1,msComboBox1,text,nom_produit_vie_mg
GetDialogProperty>Dialog1,msComboBox2,text,nom_produit_par
GetDialogProperty>Dialog1,msComboBox3,text,nom_taux
GetDialogProperty>Dialog1,msComboBox4,text,nom_plateforme
GetDialogProperty>Dialog1,msComboBox5,text,nom_cie
GetDialogProperty>Dialog1,edt_prest_1,text,nom_prest_1
GetDialogProperty>Dialog1,edt_prest_2,text,nom_prest_2
GetDialogProperty>Dialog1,edt_prest_3,text,nom_prest_3
GetDialogProperty>Dialog1,edt_prest_4,text,nom_prest_4
GetDialogProperty>Dialog1,edt_prest_5,text,nom_prest_5
GetDialogProperty>Dialog1,edt_prest_6,text,nom_prest_6
GetDialogProperty>Dialog1,edt_prest_7,text,nom_prest_7
GetDialogProperty>Dialog1,edt_prest_8,text,nom_prest_8
GetDialogProperty>Dialog1,edt_prest_9,text,nom_prest_9
GetDialogProperty>Dialog1,edt_prest_10,text,nom_prest_10
GetDialogProperty>Dialog1,MSListBox1,SelectedItems,nom_scenario
If>%nom_scenario%<>
Let>MSG_WIDTH=750
MDL>%nom_scenario%
endif
//assigner le code plateforme au choix plateforme
if>nom_plateforme=Assurance vie / Maladies graves
//Gosub>PRODUITS_VIE
Let>code_plateforme=1037400001
MDL>code_plateforme
endif
if>nom_plateforme=Assurance vie avec participation
//Gosub>PRODUITS_PAR
Let>code_plateforme=1037400003
MDL>code_plateforme
endif
if>nom_plateforme=Assurance vie universelle
Let>code_plateforme=1037400002
endif
if>nom_plateforme=Assurance invalidité
Let>code_plateforme=1037400004
endif
//SRT>PRODUITS_PAR
//assigner le code produit au choix produit par
if>nom_produit_par=Vie entière payable 10 ans - Patrimoine bonifié
Let>code_produit=PE10
endif
if>nom_produit_par=Vie entière payable 10 ans - Croissance accélérée
Let>code_produit=PF10
endif
if>nom_produit_par=Vie entière payable 20 ans - Patrimoine bonifié
Let>code_produit=PE20
endif
if>nom_produit_par=Vie entière payable 20 ans - Croissance accélérée
Let>code_produit=PF20
endif
if>nom_produit_par=Vie entière payable à 100 ans - Patrimoine bonifié
Let>code_produit=PE00
endif
if>nom_produit_par=Vie entière payable à 100 ans - Croissance accélérée
Let>code_produit=PF00
endif
//END>PRODUITS_PAR
//SRT>PRODUITS_VIE
//assigner le code produit au choix produit vie mg
if>nom_produit_vie_mg=Vie entière garantie payable 10 ans
Let>code_produit=LW10
endif
if>nom_produit_vie_mg=Vie entière garantie payable 15 ans
Let>code_produit=LW15
endif
if>nom_produit_vie_mg=Vie entière garantie payable 20 ans
Let>code_produit=LW20
endif
if>nom_produit_vie_mg=Vie entière garantie payable 65 ans
Let>code_produit=LW65
endif
if>nom_produit_vie_mg=Vie entière garantie payable à 100 ans
Let>code_produit=LW00
endif
if>nom_produit_vie_mg=Temporaire à 100 ans
Let>code_produit=LT00
endif
if>nom_produit_vie_mg=Temporaire 10 ans
Let>code_produit=LT10
endif
if>nom_produit_vie_mg=Temporaire 20 ans
Let>code_produit=LT20
endif
if>nom_produit_vie_mg=Temporaire 30 ans
Let>code_produit=LT30
endif
if>nom_produit_vie_mg=Temporaire 65 ans
Let>code_produit=LT65
endif
if>nom_produit_vie_mg=Priorité santé - temporaire 10 ans
Let>code_produit=MGT10
endif
if>nom_produit_vie_mg=Priorité santé - temporaire 20 ans
Let>code_produit=MGT20
endif
if>nom_produit_vie_mg=Priorité santé - temporaire 65 ans
Let>code_produit=MGT65
endif
if>nom_produit_vie_mg=Priorité santé - temporaire 75 ans
Let>code_produit=MGT75
endif
if>nom_produit_vie_mg=Priorité santé - payable 10 ans
Let>code_produit=MGT110
endif
if>nom_produit_vie_mg=Priorité santé - payable 20 ans
Let>code_produit=MGT120
endif
if>nom_produit_vie_mg=Priorité santé - enfant, payable 20 ans
Let>code_produit=MGTE
endif
if>nom_produit_vie_mg=Priorité santé - payable à 100 ans
Let>code_produit=MGT100
endif
if>nom_produit_vie_mg=Priorité santé - affaires, temporaire à 75 ans
Let>code_produit=CPPT75
endif
if>nom_produit_vie_mg=Priorité santé - affaires, temporaire à 100 ans
Let>code_produit=CPPT100
endif
//END>PRODUITS_VIE
//assigner le code sexe au choix sexe
If>chkMale=True
Let>code_sexe=Homme
Endif
If>chkSexFemme=True
Let>code_sexe=Femme
Endif
//assigner le code age
if>code_age1<>
Let>code_age_1=code_age1
Let>nb_scenario_age=1
endif
if>code_age2<>
Let>code_age_2=code_age2
Let>nb_scenario_age=2
endif
if>code_age3<>
Let>code_age_3=code_age3
Let>nb_scenario_age=3
endif
if>code_age4<>
Let>code_age_4=code_age4
Let>nb_scenario_age=4
endif
if>code_age5<>
Let>code_age_5=code_age5
Let>nb_scenario_age=5
endif
if>code_age6<>
Let>code_age_6=code_age6
Let>nb_scenario_age=6
endif
if>code_age7<>
Let>code_age_7=code_age7
Let>nb_scenario_age=7
endif
if>code_age8<>
Let>code_age_8=code_age8
Let>nb_scenario_age=8
endif
if>code_age9<>
Let>code_age_9=code_age9
Let>nb_scenario_age=9
endif
if>code_age10<>
Let>code_age_10=code_age10
Let>nb_scenario_age=10
endif
//assigner le code taux au choix taux
if>nom_taux=Privilégié / Non-fumeur
Let>code_taux=1
endif
if>nom_taux=Régulier / Fumeur
Let>code_taux=2
endif
//assigner le code cie au choix cie
if>nom_cie=Desjardins
Let>code_cie=1
endif
if>nom_cie=Canada Vie
Let>code_cie=2
endif
if>nom_cie=Empire
Let>code_cie=3
endif
if>nom_cie=Equitable
Let>code_cie=4
endif
if>nom_cie=IA
Let>code_cie=5
endif
if>nom_cie=Manuvie
Let>code_cie=6
endif
if>nom_cie=RBC
Let>code_cie=7
endif
if>nom_cie=SunLife
Let>code_cie=8
endif
/*
MDL>nom_plateforme
MDL>code_plateforme
MDL>nom_produit
MDL>code_produit
MDL>code_sexe
MDL>code_age
MDL>nom_taux
MDL>code_taux
*/
//assigner le code prestation au choix prestation
if>nom_prest_1<>
Let>code_prest_1=nom_prest_1
Let>nb_scenario=1
//MDL>code_prest_1
endif
if>nom_prest_2<>
Let>code_prest_2=nom_prest_2
Let>nb_scenario=2
//MDL>code_prest_2
endif
if>nom_prest_3<>
Let>code_prest_3=nom_prest_3
Let>nb_scenario=3
//MDL>code_prest_3
endif
if>nom_prest_4<>
Let>code_prest_4=nom_prest_4
Let>nb_scenario=4
//MDL>code_prest_4
endif
if>nom_prest_5<>
Let>code_prest_5=nom_prest_5
Let>nb_scenario=5
//MDL>code_prest_5
endif
if>nom_prest_6<>
Let>code_prest_6=nom_prest_6
Let>nb_scenario=6
//MDL>code_prest_6
endif
if>nom_prest_7<>
Let>code_prest_7=nom_prest_7
Let>nb_scenario=7
//MDL>code_prest_7
endif
if>nom_prest_8<>
Let>code_prest_8=nom_prest_8
Let>nb_scenario=8
//MDL>code_prest_8
endif
if>nom_prest_9<>
Let>code_prest_9=nom_prest_9
Let>nb_scenario=9
//MDL>code_prest_9
endif
if>nom_prest_10<>
Let>code_prest_10=nom_prest_10
Let>nb_scenario=10
//MDL>code_prest_10
endif
//MDL>nom_cie
//MDL>code_cie
//MDL>Nombre de scénario : %nb_scenario%
//Set the list text
Let>item_Liste=
Let>x=0
While>x<%nb_scenario%
Let>x=x+1
Let>montant=code_prest_%x%
Let>code_age=code_age_%x%
Let>item=scénario %x% : %code_sexe% %code_age% %nom_taux% %montant%
Let>item_Liste=%item_Liste%%item%%CRLF%
SetDialogProperty>Dialog1,MSListBox1,Text,%item_Liste%
EndWhile
//CloseDialog>Dialog1
END>Process