| || |
included sbl/sbh files losing scope when debugging
hi i was just wondering if anyone knew a way around this problem.
i currently have several variations of a script pointing at a "Functions" script.
i do the usual
so when i am stepping through my cursors stays at the first line where it jumps to the function call and i do not see any of the code so that i can step through it line by line.
i see the variables and such in scope and it works, but at times when i hit some sort of exception/error i am unable to analyze it unless i modify some other things in the code and play it straight through the Functions.rec script.
Use a Library instead.
Put the functions in a functions.sbl file using new->SQABasic File->Library.
Put declarations for all exported functions in a functions.sbh file using new->SQABasic File->Header.
Make sure to use the following format for the declarations
<font class="small">Code:</font><hr /><pre>Declare Function functionName BasicLib "functions" ()as Integer</pre><hr />
Then put the following statment in your script.
<font class="small">Code:</font><hr /><pre>'$Include "functions.sbh" </pre><hr />
This works for me. [img]/images/graemlins/smile.gif[/img]
The only limitation is that Test manager seems to not realize that the function is in a library if there is an error it claims it's in the calling script. This means when you ask it to open the script file it opens the wrong one. It knows the correct line number though. [img]/images/graemlins/frown.gif[/img]
Does anyone knows how to fix that problem?
Re: Use a Library instead.
I'm having a problem with my custom function. .
When I compile I receive an error: 'Compiling 32K Invoke.rec...
32Karat.sbh(3) Error: Bad declare'
Here's what I have in my script, .sbl and .sbh file:
Declare Function 32KaratClose BasicLib "32Karat" () As Integer
Any help is much appreciated.
Bad Variable Name
don't resurrect old threads for new questions
Your problem is that Function names cannot begin with a number.
Here is a quote from the Syntax summary Help Page
[ QUOTE ]
An SQABasic name (such as variable and label names) must start with a letter (A through Z, a through z). The remaining part of a name can also contain numeric digits (0 through 9) or an underscore character (_). A name cannot be more than 40 characters in length. Type-declaration characters are not considered part of a name.
[/ QUOTE ]
This applies to function and subprocedure names also
Re: Bad Variable Name
Thanks for the information(I figured it out). I posted in this thread since it was indeed library related.