title: TCL script Need Help to Optimise If and also Correction of the 3rd Output
body: <p>I have the following code, and would like to know how to:</p>
  
  <p>1) Optimise the "if", so in future if I have 10 new customer_id, I don't have to write 10 time the if-then-else statement, any suggestion?</p>
  
  <p>2) Notice the output for no.3 its wrong, it should not be calculating (divide 1.5) how do I correct it?</p>
  
  <p><strong>TCL Source Script</strong></p>
  
  <pre><code>set VG01 0
  set VT01 0
  set VG02 0
  set VT02 0
  set VG03 0
  set VT03 0
  set VGtable01 150
  set VTtable01 15
  set VGtable02 250
  set VTtable02 25
  set VGtable03 350
  set VTtable03 35
  set sCompareCustomerID01 "0001"
  set sCompareCustomerID02 "0002"
  set sCompareCustomerID03 "0003"
  set sCustomer01 "0001"
  set sCustomer02 "0002"
  set sCustomer03 "0004"
  
  if {[string compare $sCompareCustomerID01 $sCustomer01 ] == 0 ||
      [string compare $sCompareCustomerID02 $sCustomer02 ] == 0 ||
      [string compare $sCompareCustomerID03 $sCustomer03 ] == 0 } {
      set VG01 [expr $VGtable01 / 1.5]
      set VT01 [expr $VTtable01 / 1.5]
      set VG02 [expr $VGtable02 / 1.5]
      set VT02 [expr $VTtable02 / 1.5]
      set VG03 [expr $VGtable03 / 1.5]
      set VT03 [expr $VTtable03 / 1.5]
  } else {
      set VG01 $VGtable01
      set VT01 $VTtable01
      set VG02 $VGtable02
      set VT02 $VTtable02
      set VG03 $VGtable03
      set VT03 $VTtable03
  }
  
  puts  "Target Value_Group 01: $VG01"
  puts  "Target Value_Transaction 01: $VT01"
  puts  "Target Value_Group 02: $VG02"
  puts  "Target Value_Transaction 02: $VT02"
  puts  "Target Value_Group 03 : $VG03"
  puts  "Target Value_Transaction 03: $VT03"
  </code></pre>
  
  <p><strong>============</strong></p>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>Import started at 26 Mar 2020 04:09:58.</p>
    
    <hr>
    
    <p>Loading Script DLL<br>
    C:\Program Files (x86)\Common Files\Cubeware\cwscript85.dll<br>
    MMM-2020 </p>
    
    <hr>
    
    <p>200325_test division 1.5: Starting jobs at 26 Mar 2020 04:09:58<br>
    Execute script: 200325_test division 1.5 - Started at 26 Mar 2020 04:09:58  </p>
  
  <pre><code>Target Value_Group 01: 100.0 
  Target Value_Transaction 01: 10.0 
  Target Value_Group 02: 166.6666666666667 
  Target Value_Transaction 02: 16.66666666666667 
  Target Value_Group 03 : 233.3333333333333      &lt; ------ this should be 350, no calculation require
  Target Value_Transaction 03: 23.33333333333333 &lt; ------ this should be 35, no calculation require
  </code></pre>
    
    <hr>
    
    <p>Freeing resources<br>
    Import completed<br>
    Import finished at 26 Mar 2020 04:09:58</p>
  </blockquote>