Board index » off-topic » Visual basic line numbers vs. error parser (hopefully formatted better)

Visual basic line numbers vs. error parser (hopefully formatted better)


2004-01-21 12:22:06 AM
off-topic3
Visual Basic 6
CW 6.5
When compiling Visual Basic from the command line within CW,
the error line number returned by Visual Basic is the line
number referenced from the strat of that portion of the source
file that is normally accessible to the programmer in the Visual
Basic IDE. (There is a lot of control definition code in form
modules that preceeds this point, and is hidden from the
programmer in the IDE.)
However, CW uses the error number to position the cursor
relative to the first physical line the source file, which is
not line that has the error. If I take the line number where
the control stuff ends and add it to the line number in the
error file, I'm exactly on the line that actually has the error.
Either CW should add the number of lines consumed by the control
definition code to the error line number for purposes of
positioning the cursor, or Visual Basic should be able to report
the absolute error line. I've explored both options with no
success.
Any ideas on how I can handle this and automatically get
positioned to the correct line when an error occurs?
Thanks,
Mike
.
 
 

Re:Visual basic line numbers vs. error parser (hopefully formatted better)

Yes ...
suck the error file into a buffer
Make a pass through it to make the adjustment
Write it to disk
Sleep( 2048 );
Read it in as an error file
This technique works fine in a DLL but the Sleep function is not available
in a macro. It takes some time for CodeWright to empty its write buffer and
operating without the Sleep will result in you re-reading the original file
and not the modified file.
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
"Mike" < XXXX@XXXXX.COM >wrote in message
Quote

Visual Basic 6
CW 6.5


When compiling Visual Basic from the command line within CW,
the error line number returned by Visual Basic is the line
number referenced from the strat of that portion of the source
file that is normally accessible to the programmer in the Visual
Basic IDE. (There is a lot of control definition code in form
modules that preceeds this point, and is hidden from the
programmer in the IDE.)


However, CW uses the error number to position the cursor
relative to the first physical line the source file, which is
not line that has the error. If I take the line number where
the control stuff ends and add it to the line number in the
error file, I'm exactly on the line that actually has the error.


Either CW should add the number of lines consumed by the control
definition code to the error line number for purposes of
positioning the cursor, or Visual Basic should be able to report
the absolute error line. I've explored both options with no
success.


Any ideas on how I can handle this and automatically get
positioned to the correct line when an error occurs?


Thanks,


Mike
.
 

Re:Visual basic line numbers vs. error parser (hopefully formatted better)

Thanks Thom.
I currently lack the means to create a dll. Though I have done it in the past, it's been a few years, and I don't have a C compiler. (I've actually spent quite a while converting the functionality of my language dlls to macros.)
Do you suppose that it would work to simulate Sleep from a macro, perhaps by running a no-op loop of some sort a few thousand times, or would CW simply devote itself to the loop, and not start emptying the write buffer until the loop was complete?
Alternately, could one shell out to the OS and run a VBscript or a utility that would similate Sleep?
Thanks again,
Mike
.
"Thom Little" < XXXX@XXXXX.COM >wrote:
Quote
Yes ...

suck the error file into a buffer
Make a pass through it to make the adjustment
Write it to disk
Sleep( 2048 );
Read it in as an error file

This technique works fine in a DLL but the Sleep function is not available
in a macro. It takes some time for CodeWright to empty its write buffer and
operating without the Sleep will result in you re-reading the original file
and not the modified file.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"Mike" < XXXX@XXXXX.COM >wrote in message
news:400d63be$ XXXX@XXXXX.COM ...
>
>Visual Basic 6
>CW 6.5
>
>
>When compiling Visual Basic from the command line within CW,
>the error line number returned by Visual Basic is the line
>number referenced from the strat of that portion of the source
>file that is normally accessible to the programmer in the Visual
>Basic IDE. (There is a lot of control definition code in form
>modules that preceeds this point, and is hidden from the
>programmer in the IDE.)
>
>
>However, CW uses the error number to position the cursor
>relative to the first physical line the source file, which is
>not line that has the error. If I take the line number where
>the control stuff ends and add it to the line number in the
>error file, I'm exactly on the line that actually has the error.
>
>
>Either CW should add the number of lines consumed by the control
>definition code to the error line number for purposes of
>positioning the cursor, or Visual Basic should be able to report
>the absolute error line. I've explored both options with no
>success.
>
>
>Any ideas on how I can handle this and automatically get
>positioned to the correct line when an error occurs?
>
>
>Thanks,
>
>
>Mike
>.


 

{smallsort}

Re:Visual basic line numbers vs. error parser (hopefully formatted better)

Now that you know what to look for you could play with it and see if there
was something you could loop on long enough to guarantee that the write
completed.
It really is too bad that they never implemented an interlock on the write
so you could guarantee that it was done.
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
"Mike" < XXXX@XXXXX.COM >wrote in message
Quote

Thanks Thom.

I currently lack the means to create a dll. Though I have done it in the
past, it's been a few years, and I don't have a C compiler. (I've actually
spent quite a while converting the functionality of my language dlls to
macros.)
Quote

Do you suppose that it would work to simulate Sleep from a macro, perhaps
by running a no-op loop of some sort a few thousand times, or would CW
simply devote itself to the loop, and not start emptying the write buffer
until the loop was complete?
Quote

Alternately, could one shell out to the OS and run a VBscript or a utility
that would similate Sleep?

Thanks again,

Mike
.

"Thom Little" < XXXX@XXXXX.COM >wrote:
>Yes ...
>
>suck the error file into a buffer
>Make a pass through it to make the adjustment
>Write it to disk
>Sleep( 2048 );
>Read it in as an error file
>
>This technique works fine in a DLL but the Sleep function is not
available
>in a macro. It takes some time for CodeWright to empty its write buffer
and
>operating without the Sleep will result in you re-reading the original
file
>and not the modified file.
>
>--
>-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
>--
>
>"Mike" < XXXX@XXXXX.COM >wrote in message
>news:400d63be$ XXXX@XXXXX.COM ...
>>
>>Visual Basic 6
>>CW 6.5
>>
>>
>>When compiling Visual Basic from the command line within CW,
>>the error line number returned by Visual Basic is the line
>>number referenced from the strat of that portion of the source
>>file that is normally accessible to the programmer in the Visual
>>Basic IDE. (There is a lot of control definition code in form
>>modules that preceeds this point, and is hidden from the
>>programmer in the IDE.)
>>
>>
>>However, CW uses the error number to position the cursor
>>relative to the first physical line the source file, which is
>>not line that has the error. If I take the line number where
>>the control stuff ends and add it to the line number in the
>>error file, I'm exactly on the line that actually has the error.
>>
>>
>>Either CW should add the number of lines consumed by the control
>>definition code to the error line number for purposes of
>>positioning the cursor, or Visual Basic should be able to report
>>the absolute error line. I've explored both options with no
>>success.
>>
>>
>>Any ideas on how I can handle this and automatically get
>>positioned to the correct line when an error occurs?
>>
>>
>>Thanks,
>>
>>
>>Mike
>>.
>
>