A Thursday Quandry...

View: New views
8 Messages — Rating Filter:   Alert me  

A Thursday Quandry...

by David Wolverton :: Rate this Message:

| View Threaded | Show Only this Message


UniData.

I have an external subroutine we call thousands of times within a program
(does G/L Account assembly from all the 'pieces' of data).  

Our logic was that making it an 'included' subroutine within the program
would make it perform faster, and I think that was a good call.

Now it sort of bites during debug, as UniData does not 'explode' the code at
compile, so that if you're doing interactive debugging, you get the 'same
line number' each time as you step through that included code - so there's
no way to know where it's at in the subroutine (and therefore, no good clue
how many lines you can do "Enn" to step through.)  It's not often that I
need this, but I'm doing it now and am not believing there is not a 'better
way'...

Is there a way to make an Included Subroutine 'insert itself' at compile
time - as if that code were REALLY in the program??

How have others dealt with this?

David W.


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Daniel McGrath :: Rate this Message:

| View Threaded | Show Only this Message

The way I've seen this handled before was by using a preprocessor.

So instead of calling BASIC to compile your code, you have your own command that wraps BASIC.

In your case, the first step would be to read each line, find the include statements and insert the code (probably with * BEGIN INCLUDE 'x' & * END INCLUDE 'x' comments to help us humans).
You would then write it to a temporary directory and call BASIC to compile that version.

Regards,
Dan

-----Original Message-----
From: u2-users-bounces@... [mailto:u2-users-bounces@...] On Behalf Of David Wolverton
Sent: Thursday, January 26, 2012 1:25 PM
To: 'U2 Users List'
Subject: [U2] A Thursday Quandry...


UniData.

I have an external subroutine we call thousands of times within a program
(does G/L Account assembly from all the 'pieces' of data).  

Our logic was that making it an 'included' subroutine within the program would make it perform faster, and I think that was a good call.

Now it sort of bites during debug, as UniData does not 'explode' the code at compile, so that if you're doing interactive debugging, you get the 'same line number' each time as you step through that included code - so there's no way to know where it's at in the subroutine (and therefore, no good clue how many lines you can do "Enn" to step through.)  It's not often that I need this, but I'm doing it now and am not believing there is not a 'better way'...

Is there a way to make an Included Subroutine 'insert itself' at compile time - as if that code were REALLY in the program??

How have others dealt with this?

David W.


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Dave Laansma :: Rate this Message:

| View Threaded | Show Only this Message

With all due respect ... ew!

Put the DEBUG command in the INCLUDED code or make it a subroutine for
the purpose of debugging it, THEN put it back when you fixed the
problem.

Sincerely,
David Laansma
IT Manager
Hubbard Supply Co.
Direct: 810-342-7143
Office: 810-234-8681
Fax: 810-234-6142
www.hubbardsupply.com
"Delivering Products, Services and Innovative Solutions"


-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of Daniel
McGrath
Sent: Thursday, January 26, 2012 3:31 PM
To: U2 Users List
Subject: Re: [U2] A Thursday Quandry...

The way I've seen this handled before was by using a preprocessor.

So instead of calling BASIC to compile your code, you have your own
command that wraps BASIC.

In your case, the first step would be to read each line, find the
include statements and insert the code (probably with * BEGIN INCLUDE
'x' & * END INCLUDE 'x' comments to help us humans).
You would then write it to a temporary directory and call BASIC to
compile that version.

Regards,
Dan

-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of David
Wolverton
Sent: Thursday, January 26, 2012 1:25 PM
To: 'U2 Users List'
Subject: [U2] A Thursday Quandry...


UniData.

I have an external subroutine we call thousands of times within a
program
(does G/L Account assembly from all the 'pieces' of data).  

Our logic was that making it an 'included' subroutine within the program
would make it perform faster, and I think that was a good call.

Now it sort of bites during debug, as UniData does not 'explode' the
code at compile, so that if you're doing interactive debugging, you get
the 'same line number' each time as you step through that included code
- so there's no way to know where it's at in the subroutine (and
therefore, no good clue how many lines you can do "Enn" to step
through.)  It's not often that I need this, but I'm doing it now and am
not believing there is not a 'better way'...

Is there a way to make an Included Subroutine 'insert itself' at compile
time - as if that code were REALLY in the program??

How have others dealt with this?

David W.


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Daniel McGrath :: Rate this Message:

| View Threaded | Show Only this Message

Alternate opinions always welcome :)

I personally dislike the 'making it a subroutine' method is it can fundamentally can change the program behaviour (changes variable scope) leaving you chasing wild geese in a house of mirrors.

-----Original Message-----
From: u2-users-bounces@... [mailto:u2-users-bounces@...] On Behalf Of Dave Laansma
Sent: Thursday, January 26, 2012 2:10 PM
To: U2 Users List
Subject: Re: [U2] A Thursday Quandry...

With all due respect ... ew!

Put the DEBUG command in the INCLUDED code or make it a subroutine for the purpose of debugging it, THEN put it back when you fixed the problem.

Sincerely,
David Laansma
IT Manager
Hubbard Supply Co.
Direct: 810-342-7143
Office: 810-234-8681
Fax: 810-234-6142
www.hubbardsupply.com
"Delivering Products, Services and Innovative Solutions"


-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of Daniel McGrath
Sent: Thursday, January 26, 2012 3:31 PM
To: U2 Users List
Subject: Re: [U2] A Thursday Quandry...

The way I've seen this handled before was by using a preprocessor.

So instead of calling BASIC to compile your code, you have your own command that wraps BASIC.

In your case, the first step would be to read each line, find the include statements and insert the code (probably with * BEGIN INCLUDE 'x' & * END INCLUDE 'x' comments to help us humans).
You would then write it to a temporary directory and call BASIC to compile that version.

Regards,
Dan

-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of David Wolverton
Sent: Thursday, January 26, 2012 1:25 PM
To: 'U2 Users List'
Subject: [U2] A Thursday Quandry...


UniData.

I have an external subroutine we call thousands of times within a
program
(does G/L Account assembly from all the 'pieces' of data).  

Our logic was that making it an 'included' subroutine within the program
would make it perform faster, and I think that was a good call.

Now it sort of bites during debug, as UniData does not 'explode' the
code at compile, so that if you're doing interactive debugging, you get
the 'same line number' each time as you step through that included code
- so there's no way to know where it's at in the subroutine (and
therefore, no good clue how many lines you can do "Enn" to step
through.)  It's not often that I need this, but I'm doing it now and am
not believing there is not a 'better way'...

Is there a way to make an Included Subroutine 'insert itself' at compile
time - as if that code were REALLY in the program??

How have others dealt with this?

David W.


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Dan Goble-3 :: Rate this Message:

| View Threaded | Show Only this Message

We have used the -D and -Z2 options when compiling and it lets us see the code from the included items when in the debugger.

-Dan


Dan Goble | IT Senior Software Engineer

Interline Brands, Inc.
804 East Gate Drive Suite 100, Mount Laurel, NJ 08054
Office: 856.533.3110 | Mobile: 609.792.6855
E-mail: Dan.Goble@... | Website: www.interlinebrands.com

_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by David Wolverton :: Rate this Message:

| View Threaded | Show Only this Message

I've ALWAYS done the -Z ... never noticed the -Z2 option -- that would read
as if it's the answer!  I'll give that a try.

-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of Dan Goble
Sent: Thursday, January 26, 2012 3:49 PM
To: U2 Users List
Subject: Re: [U2] A Thursday Quandry...

We have used the -D and -Z2 options when compiling and it lets us see the
code from the included items when in the debugger.

-Dan


Dan Goble | IT Senior Software Engineer

Interline Brands, Inc.
804 East Gate Drive Suite 100, Mount Laurel, NJ 08054
Office: 856.533.3110 | Mobile: 609.792.6855
E-mail: Dan.Goble@... | Website: www.interlinebrands.com

_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Dan Goble-3 :: Rate this Message:

| View Threaded | Show Only this Message

You will want the -D option also.   This creates the cross reference table for the debugger.   Need to use the -Z2 and -D in combination.

-Dan


Dan Goble | IT Senior Software Engineer

Interline Brands, Inc.
804 East Gate Drive Suite 100, Mount Laurel, NJ 08054
Office: 856.533.3110 | Mobile: 609.792.6855
E-mail: Dan.Goble@... | Website: www.interlinebrands.com

-----Original Message-----
From: u2-users-bounces@... [mailto:u2-users-bounces@...] On Behalf Of David Wolverton
Sent: Thursday, January 26, 2012 4:59 PM
To: 'U2 Users List'
Subject: Re: [U2] A Thursday Quandry...

I've ALWAYS done the -Z ... never noticed the -Z2 option -- that would read as if it's the answer!  I'll give that a try.

-----Original Message-----
From: u2-users-bounces@...
[mailto:u2-users-bounces@...] On Behalf Of Dan Goble
Sent: Thursday, January 26, 2012 3:49 PM
To: U2 Users List
Subject: Re: [U2] A Thursday Quandry...

We have used the -D and -Z2 options when compiling and it lets us see the code from the included items when in the debugger.

-Dan


Dan Goble | IT Senior Software Engineer

Interline Brands, Inc.
804 East Gate Drive Suite 100, Mount Laurel, NJ 08054
Office: 856.533.3110 | Mobile: 609.792.6855
E-mail: Dan.Goble@... | Website: www.interlinebrands.com

_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users

Re: A Thursday Quandry...

by Tony Gravagno-3 :: Rate this Message:

| View Threaded | Show Only this Message

Dan hit it on the head.  I have such a pre-processor (somewhere?)
written several times over in angst when working on various
systems.  David - I'll try to find it today and send it over,
then will probably post to my website.

T

> From: Daniel McGrath
> The way I've seen this handled before was by using a
> preprocessor.
>
> So instead of calling BASIC to compile your code, you
> have your own command that wraps BASIC.
>
> In your case, the first step would be to read each
> line, find the include statements and insert the code
> (probably with * BEGIN INCLUDE 'x' & * END INCLUDE 'x'
> comments to help us humans). You would then write it
> to a temporary directory and call BASIC to compile
> that version.


_______________________________________________
U2-Users mailing list
U2-Users@...
http://listserver.u2ug.org/mailman/listinfo/u2-users