Operating System - OpenVMS
1748027 Members
4205 Online
108757 Solutions
New Discussion юеВ

Re: Porting VAX Basic code to itanium

 

Porting VAX Basic code to itanium

I am facing a problem in porting my VAX-BASIC code to Itanium. Here this basic code is giving error with a basic function ERL . As we have changed the all the line no to label No . So what could be best possible way of substituting the ERL Function on itanium.
11 REPLIES 11
abrsvc
Respected Contributor

Re: Porting VAX Basic code to itanium

To best respond to this, a copy of the error would be most helpful. Can you attach a part of the listing that shows the error?

Thanks,
Dan

Re: Porting VAX Basic code to itanium

it say ERL function is not supported . As Basic language is new to me i do not able to write a code to bypass ERL function . so need som help to write a code ti subtitute the ERL function on BASIC Program.
abrsvc
Respected Contributor

Re: Porting VAX Basic code to itanium

Let me restate this:

If you can post the code segment that has the ERL function currently, we can understand how it was used and can then suggest how to recode the segment to avoid its use. Without the context of how the ERL function is used, we cannot provide an alternative. In many cases, this ERL function is used to determine actions for particular failures. Using OpenVMS status code values rather than line numbers, similar functions can be performed. Showing us the code segment will allow us to determine the easiest way to mimic the current functions.

Thanks,
Dan

Re: Porting VAX Basic code to itanium

It will lok something like

If ERR = 51% and ERL 5102
then
Print "ERROR IN LINE 5102"
RESUME 5120
So from above if there is an error in line 5120 it will print just for a example . So now if we have to remove ERL function BASIC Code (.BAS).
abrsvc
Respected Contributor

Re: Porting VAX Basic code to itanium

It looks like the code is trapping for specific error codes and printing an error message than continuing on to process additional work.

Changing this to a more specific check like the following (not Basic code, but descriptive lines) should work:

At line X would be the following:

Code_line = 5105
{execute line 5105}
.
.
.
If err = %51 and code_line=5105
then...
resume 5120

===============
The main differene here is that you manually set the code_line variable wherever necesary. While not the most elegant solution, this will work.

An alternative would be to post the exact code segment in question rather than your short example. Perhaps the error codes being checked are standard RMS or other codes that can be handled in a different manner.

Hope this helps a bit,

Dan
John Gillings
Honored Contributor

Re: Porting VAX Basic code to itanium

I'd suggest you rip out that style of error handling/reporting and use the tools available from the operating system.

For example, rather than writing code which is dependent on (hard coded!) specific line numbers, use LIB$SIGNAL to generate a traceback message, which will automatically list line numbers, module offsets and absolute addresses.

Use exception handlers to catch and handle errors. From what I've seen, ERL is a clumsy and ugly mechanism which has only been used "because it's there". If it were a truly useful and necessary feature, it would have been implemented on Itanium.

Look at what's it's really being used for and find a better way to do it. Without seeing real code, it's difficult for us to make specific suggestions.
A crucible of informative mistakes
Kerry Gibbings
Advisor

Re: Porting VAX Basic code to itanium

"it say ERL function is not supported"

Where?

ERL works fine on Itanium. Of cource if you remove line numbers from the program or compile/link without line number support it won't work.

Port your VAX BASIC code as is, it will probably work without the need for any changes. Once you've ported then look at what you may want to do with regard to line numbers.

Programs without line numbers will run faster, but then you should use the When Error In/Use, End When contructs.

Look up BASIC/[NO]LINES in BASIC help.
Jonathan Cronin
Advisor

Re: Porting VAX Basic code to itanium

ERL (ERror Line) requires using line numbers; the corresponding functionality without line numbers is the when clause:

when error in
use
end when

Without seeing the code Its hard to be specific but

10 on error goto 19000
20 i% = integer( "AAA", long )
30 call foo(i%)
40 goto 32767
19000 if erl = 20 and err = 52 then print "failed"
32767 end

without line numbers is:

when error in
i% = integer( "A" )
call foo(i%)
use
print "failed"
end when

end

or:

when error in
i%= integer( "A" )
call foo(i%)
use like19000

handler like19000
print "Failed"
end handler

Jonathan
Ramondo
Advisor

Re: Porting VAX Basic code to itanium

The problem is that you've replaced all the line numbers with labels. The compiler then handles it as a "no line numbers" program and your resultant problem. This is not specific to Itanium.

Putting just one line number would fix this. e.g. if the first line of your program was:

1 ! Dummy line no

it would (should) compile.