Post
by Jeff Luther » 21 Aug 2007, 00:16
Posted by: Jeff Luther
Well, I can get you along your way because I have a CDKTutorial demo on my
info/samples link below. Click on that, then Samples; they are listed in
alpha order. And if you don't know the CDK at all, this will also provide
an intro.
Basically, to count function/msg. lines you need to:
-- be aware not to count lines beginning with "!" the comment char. You
can parse that or use IsComment() to ignore (unless you are counting
comments as well).
-- Call CDK_App.InitFromFile( )
Call CDK_App.InitializeFramework()
-- now the global var. CDK_App is a handle to your app.
-- in the CDKTutorial, collapse the outline, turn on animate and click on
the radio button to EnumFunctions as a sample.
-- and as the demo shows, the code to display names and most details of
the functions pseudo-codes like this:
Set nFunctsTotal = CDK_App.EnumFunctions( sAryFunctNames )
Call CDK_App.GetFunction( sAryFunctNames[nFunct], oFunction )
Call oFunction.GetReturnType( sValue )
Set nParmsTotal = oFunction.EnumParameters( sAryParmNames, sAryParmTypes )
Set nVarsTotal = oFunction.EnumStaticVariables( sAryVarNames, sAryVarTypes )
Set nVarsTotal = oFunction.EnumLocalVariables( sAryVarNames, sAryVarTypes )
Call oFunction.GetActions( oActionBlock )
Each call (generally) stuffs a string array with details about that outline section.
-- the GetAction() details is what I didn't write in the demo but you need is to loop
through the oActionBlock. That's where your lines in the function are.
-- Look at the CDK Functional Class: cdkActionBlock for its functions that are used
to traverse the down the actions section. Msg. Actions works about the same.
I would suggest you write a test case and if you get stuck, submit it here as a text
app. along with a specific quesiont. That usually gives you the best chance to get
some help.
Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/gupta/