AStackInfo Function | |
-- todo --
Creates an array and populates it with information about the current state of the call stack.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION AStackInfo(
ArrayName
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual AStackInfo(
Usual ArrayName = default
)
Request Example
View SourceParameters
- ArrayName (Optional)
- Type: Usual
Specifies the name of the array to store information about the call stack.
Return Value
Type:
Usual
Numeric
Remarks
The following table describes the information returned by the AStackInfo( ) function:
1 | Call Stack Level |
2 | Current program filename |
3 | Module or Object name |
4 | Module or Object Source filename |
5 | Line number in the object source file |
6 | Source line contents |
AStackInfo( ) populates an array with information about the entire calling stack.
It combines functionality of SYS(16) and Program( ) functions while adding new support for line numbers at each call stack level.
The value returned is the number of program levels or rows of the returned array.
AStackInfo( ) only populates the 6th array element if source line contents are available, otherwise it will be left empty.
AStackInfo( ) provides, in the 2nd and 4th elements respectively, the name of the current file and,
if the file is bound in an APP or other separate file, a full path name to the binding program.
The 4th element contains the original source file information.
For objects, this is same information returned by SYS(16), even when bound inside of applications.
AStackInfo() might not be able to retrieve information about program (.prg) files.
In this case, X# displays the 2nd element similar to the SYS(16) function. For more information, see SYS(16) - Executing Program File Name.
Examples 1AStackInfo(myarray)
2Display MEMO LIKE myarray
3myArray
4(1,1) 1
5(1,2) c:\vfp\myAppl.app
6(1,3) frmRerport.PrintReport.Click
7(1,4) c:\vfp\myclasses\buttons.vct
8(1,5) 42
9(1,6) THISForM.DoReport()
10(2,1) 2
11(2,2) c:\vfp\myAppl.app
12(2,3) frmRerport.DoReport
13(2,4) c:\vfp\forms\frmRerport.sct
14(2,5) 31
15(2,6) DO RunListReport
16(3,1) 3
17(3,2) c:\vfp\myAppl.app
18(3,3)
19(3,4) c:\vfp\programs\runlisterport.prg
20(3,5) 12
21(3,6) REPORT ForM myreport1.frx
22(4,1) 4
23(4,2) c:\vfp\reports\myreport1.frt
24(4,3) myreport1.DataEnvironment.BeforeOpenTables
25(4,4) c:\vfp\reports\myreport1.frt
26(4,5) 31
27(4,6) DO ForM getcusts
28(5,1) 5
29(5,2) c:\vfp\myAppl.app
30(5,3) getcusts.init
31(5,4) c:\vfp\forms\getcusts.sct
32(5,5) 2
33(5,6) AStackInfo(myarray)
See Also