title: How to create dynamic case function?
body: <p>I am using this in my asp code and I want to compact this code.</p>
  
  <p>for expert asp please help me modify my code , I also need to dynamically case </p>
  
  <p>like</p>
  
  <pre><code>for i=1 to 50
      ....
  next
  
  
  &lt;%m=40000
  Dim StockValue:StockValue=m
  numn=30000
  
   Select Case True
  Case StockValue&lt;=numn*1:G=1:Case StockValue&lt;=numn*2:G=2:
  Case StockValue&lt;=numn*3:G=3:Case StockValue&lt;=numn*4:G=4:
  Case StockValue&lt;=numn*5:G=5:Case StockValue&lt;=numn*6:G=6:
  Case StockValue&lt;=numn*7:G=7:Case StockValue&lt;=numn*8:G=8:
  Case StockValue&lt;=numn*9:G=9:Case StockValue&lt;=numn*10:G=10:
  Case StockValue&lt;=numn*11:G=11:Case StockValue&lt;=numn*12:G=12:
  Case StockValue&lt;=numn*13:G=13:Case StockValue&lt;=numn*14:G=14:
  Case StockValue&lt;=numn*15:G=15:Case StockValue&lt;=numn*16:G=16:
  Case StockValue&lt;=numn*17:G=17:Case StockValue&lt;=numn*18:G=18:
  Case StockValue&lt;=numn*19:G=19:Case StockValue&lt;=numn*20:G=20:
  Case StockValue&lt;=numn*21:G=21:Case StockValue&lt;=numn*22:G=22:
  Case StockValue&lt;=numn*23:G=23:Case StockValue&lt;=numn*24:G=24:
  Case StockValue&lt;=numn*25:G=25:Case StockValue&lt;=numn*26:G=26:
  Case StockValue&lt;=numn*27:G=27:Case StockValue&lt;=numn*28:G=28:
  Case StockValue&lt;=numn*29:G=29:Case StockValue&lt;=numn*30:G=30:
  Case StockValue&lt;=numn*31:G=31:Case StockValue&lt;=numn*32:G=32:
  Case StockValue&lt;=numn*33:G=33:Case StockValue&lt;=numn*34:G=34:
  Case StockValue&lt;=numn*35:G=35:Case StockValue&lt;=numn*36:G=36:
  Case StockValue&lt;=numn*37:G=37:Case StockValue&lt;=numn*38:G=38:
  Case StockValue&lt;=numn*39:G=39:Case StockValue&lt;=numn*40:G=40:
  Case StockValue&lt;=numn*41:G=41:Case StockValue&lt;=numn*42:G=42:
  Case StockValue&lt;=numn*43:G=43:Case StockValue&lt;=numn*44:G=44:
  Case StockValue&lt;=numn*45:G=45:Case StockValue&lt;=numn*46:G=46:
  Case StockValue&lt;=numn*47:G=47:Case StockValue&lt;=numn*48:G=48:
  Case StockValue&lt;=numn*49:G=49:Case StockValue&lt;=numn*50:G=50:
  
  Case Else
  End Select
  Response.write(g)%&gt;
  </code></pre>
  
  <p>Now, I also need to dynamically case function.)</p>