title: VB6 split function runtime error 9 subscript out of range
body: <pre><code>token = Split(thisfile, "List1")(1)
  
  token = RC4(token, Passwd)
  </code></pre>
  
  <p>On first line i get on vb6 runtime error 9 subscript out of range
  I haved tried with UBound but dont work...on windows 7 64 bits this error dont appear...only on 32 bits?</p>
  
  <p>full code (file scope - encryption):</p>
  
  <pre><code>Const mypass = "Passwd"
  
  Sub Main()
  
  Dim thisfile As String, token As String, selfpath As String
  
  'The path to itself
  
  selfpath = App.Path &amp; "\" &amp; App.EXEName &amp; ".exe"
  
  'open itself and get all the data in one variable
  
  Open selfpath For Binary As #1
  
  thisfile = Space(LOF(1))
  
  Get #1, , thisfile
  
  Close #1
  
  token = Split(thisfile, "List1")(1)
  
  token = RC4(token, Passwd)
  </code></pre>