Code: Select all
Procedure MY()
i=1
b=2
EndProcedure
GetprocodeSIZE(@my());??vHow To write
Gets the size Proced re code
Code: Select all
Procedure MY()
i=1
b=2
EndProcedure
GetprocodeSIZE(@my());??vHow To write
Code: Select all
FnLambdaStart:
Procedure FnLambda()
;
EndProcedure
FnLambdaEnd:
FnLambdaSize = ?FnLambdaEnd - ?FnLambdaEnd
Olliv wrote:Fn = FuNctionCode: Select all
FnLambdaStart: Procedure FnLambda() ; EndProcedure FnLambdaEnd: FnLambdaSize = ?FnLambdaEnd - ?FnLambdaEnd
"FnLambda" = Function name example
Function = Same as "procedure" (convention)
Code: Select all
Procedure MY1()
i=1
b=2
EndProcedure
Procedure MY2()
EndProcedure
sizeMY1 = @MY2() - @MY1()
Debug sizeMY1
Unusual way to generate the code but true, but now it's at least the right 0netmaestro wrote:Correct the typo and it's still 0.
Code: Select all
DisableDebugger
Procedure fun1()
a = a + 1
EndProcedure
Procedure.s fun2(a, b, c)
a$ = "hello"
For k = 1 To 10
a$ + Str(k)
Next
ProcedureReturn a$
EndProcedure
Procedure.i GetFunSize(*entry)
If ExamineAssembly(*entry)
While NextInstruction()
i$ = Trim(InstructionString())
*addr = InstructionAddress()
If Left(i$,3) = "ret"
NextInstruction()
*addr = InstructionAddress()
Break
EndIf
Wend
ProcedureReturn *addr - *entry
EndIf
ProcedureReturn 0
EndProcedure
MessageRequester("fun1()", Str(GetFunSize(@fun1())))
MessageRequester("fun2()", Str(GetFunSize(@fun2())))
Code: Select all
Procedure FunTest()
FunStart:
; Fun code
FunEnd:
EndProcedure
Code: Select all
McStart:
Macro McTest()
;McCode
EndMacro
McEnd: