Don't like ads? PRO users don't see any ads ;-)
Guest

04202012

By: a guest on Apr 20th, 2012  |  syntax: VB.NET  |  size: 1.22 KB  |  hits: 24  |  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. Sub selectSize(wsname,objnum)
  2.  
  3.  
  4. Dim tableInxnum as Integer
  5. Dim inxpoolnum as Integer
  6. Dim parentInxnum as Integer
  7. Dim parentInx() as Variant
  8. Dim selectList() as Variant
  9. Dim selectnum as Integer
  10.  
  11. tableindexnum=1
  12. selectnum=3
  13. parentInxnum=7
  14. inxpoolnum=10
  15.  
  16.  
  17. 'Copy tableinx to pumpinx
  18. parentInx=listcolfromtable(wsname,objnum,tableInxnum)
  19. Call writeArrayColTable(wsname,objnum,parentInxnum,parentInx)
  20.  
  21. 'Get selection list
  22.  
  23. selectList=listcolfromtable(wsname,objnum,selectnum)
  24.  
  25. 'copy parent index to index pool
  26. Call writeArrayColTable(wsname,objnum,inxpoolnum,parentInx)
  27.  
  28. End Sub
  29.  
  30. Function inxChildList(wsname,objnum,tableInxnum,selectionnum,selection,parentinx)
  31.  
  32. Dim children() as Variant
  33. Dim selectList() as Variant
  34. Dim tableInx() as Variant
  35. Dim count as Integer
  36.  
  37. selectList=listcolfromtable(wsname,objnum,selectionnum)
  38. tableInx=listcolfromtable(wsname,objum,tableInxnum)
  39. 'Can get a better way to find index length directly from object property
  40.  
  41. Redim children(1 to Ubound(selectList))
  42.  
  43. For i=1 to Ubound(tableInx)
  44.  
  45.         If findinlist(parentinx,i)=1 Then
  46.        
  47.                 If selection=selectList(i) Then
  48.                         count=count+1
  49.                         children(count)=selecList(i)
  50.                 End If
  51.  
  52.         End If
  53.  
  54. Next i
  55.  
  56. inxChildList=children
  57.  
  58. End Function