2010-09-02 66 views

回答

3

可以使用ASTACKINFO()函數創建一個充滿調用堆棧的數組。

1

使用ASTACKINFO像MikeReigler說,當時是這樣的:

cStack = "" 
    nStackCount = astackinfo(arrStackInfo) 

    for nCount = nStackCount to 1 step -1 

     cStack = cStack + "Level " + transform(arrStackInfo(nCount, 1)) + chr(13) 
     cStack = cStack + iif(not empty(arrStackInfo(nCount, 2)), ; 
      "Filename: " + transform(arrStackInfo(nCount, 2)) + chr(13) , "") 
     cStack = cStack + iif(not empty(arrStackInfo(nCount, 3)), ; 
      "Module/Object name: " + transform(arrStackInfo(nCount, 3)) + chr(13) , "") 
     cStack = cStack + iif(not empty(arrStackInfo(nCount, 4)), ; 
      "Module/Object filename: " + transform(arrStackInfo(nCount, 4)) + chr(13), "") 
     cStack = cStack + iif(not empty(arrStackInfo(nCount, 5)), ; 
      "Line # : " + transform(arrStackInfo(nCount, 5), "999999") + chr(13), "") 
     cStack = cStack + iif(not empty(arrStackInfo(nCount, 6)), ; 
      "Code: " + transform(arrStackInfo(nCount, 6)) + chr(13), "") 
     cStack = cStack + chr(13) 

    next 
相關問題