Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2013  |  syntax: None  |  size: 0.76 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var test_string = "1^^0^^0.000^^0^^0.0^^0.0^^0^^0^^0.0000^^0^^0^^0^^1^^2^^47^^1000^^";
  2. var good_array = [ "1", "0", "0.000", "0", "0.0", "0.0", "0", "0", "0.0000", "0", "0",     "0", "1", "2", "47", "1000", ""]
  3. var test_count = 0;
  4. var test_array = new Array(20);
  5. var bad_split_count = new Array();
  6. var bad_split_time = new Array();
  7.  
  8. function split_test ()
  9. {
  10.  
  11.     test_array = test_string.split('^^');
  12.  
  13.     var i;
  14.     for (i = 0; i < 16; i++)
  15.     {  
  16.         if (test_array[i] === good_array[i])
  17.         {
  18.             var good_item = true;
  19.         }
  20.         else
  21.         {
  22.             var d = new Date()
  23.             bad_split_time.push(d);
  24.             bad_split_count.push(test_count);
  25.             break;
  26.         }
  27.     }
  28.  
  29.     test_count++;
  30.  
  31.     setTimeout(split_test, 5);
  32. }