can´t run source after to run fortran translator

Hi every body I am translating fortran source code to truebasic but the file generated after the execution the file do not run in truebsic 6.006 the message said "6:1:Illegal line number", can help me?.

best regards

Guillermo Santos

Comments

re: line numbers

1) This is still probably an editor problem--corrected in the next release--but there are some other concerns.

a) Read Appendix E of the manual. Note that ALL lines must be numbered--not just some lines. I'd do the conversion WITHOUT the line numbers, let TRUE BASIC number the lines, then fix your GOTO statements with the appropriate numbers. [not sure you can number lines out of order in TB]
b) You can't jump into or out of control stuctures--see the manual. I haven't checked your code for this since I haven't looked at Fortran since I was 19 (and that was a very long time ago!)

2) To check if it is just an editor problem (my beta version can now handle line numbers), see if your program will compile (try with the sample program too). If it compiles, but won't run under the editor, again the best advice is to remove the line numbers. See Chapter 1 of the manual (1-6 in my hardcopy version) about this. There is strong advice to avoid line numbers. IF, DO, FOR, and SELECT CASE can effectively be used to eliminate all line number references.

rwt

re:fortran conversion

Showing us the code would help (if not too long), but 6.006 has some problems with line numbers because it has to add some temporary code when executing from the editor and one can get negative line numbers (if I am remembering correctly). My advice is to get rid of the line numbers. If you have any GOTO statements, rewrite that part of the code to eliminate them. I've not used line numbers since my Commodore-64 days and True Basic really works smoother (much easier to reuse portions of code) if you avoid them. I'm not sure if the next release of the editor, which I know Big John is working on, addresses the line number issue or not. If you need help eliminating GOTOs, post some of your code and maybe we can help.

rwt

fortran conversion

my source code is the listed code bellow, I can translate from fortran to true basic fin, but when I try to run it in Truebasic, appears the follow mesaje. "Illegal Line number" in several parts, how can I solve the problem?, I try to run the samplef.tru in true basic and have the same problem.

C T = TEMPERATURA EN GRADOS K
C X = FRACCION MOL
DIMENSION X(5),GAMMA(5),TEXT(80)
DIMENSION ITAB(5,77)
COMMON NY(5,8),R(8),Q(8),RS(5),QS(5),XL(5),NR
100 FORMAT(40I2)
101 FORMAT(8F10.4)
102 FORMAT(4X,F10.1,10F10.4)
103 FORMAT(///,1X,11Htemperatura,1X,32H *** fraccion mol y coeficientes,
1 34H de actividad para cada componente,/)
104 FORMAT(///,80A1,/)
105 FORMAT(80A1)
NT=56
199 READ(5,105) TEXT
READ(5,100) NK,NG
IF (NK .EQ. 0) GO TO 99
WRITE(6,104) TEXT
NR=0
DO 1 I=1,NK
1 READ(5,100) (ITAB(I,J),J=1,NT)
98 READ(5,101) T,(X(I),I=1,NK)
IF (T .EQ.0) GO TO 199
CALL UNIFA (NK,NG,ITAB,T,X,GAMMA)
IF (NR .GT. 0)GO TO 2
WRITE(6,103)
2 NR=NR+1
WRITE(6,102) T, (X(I),GAMMA(I),I=1,NK)
GO TO 98
99 CONTINUE
STOP
END
C

fortran conversion

Guillermo:

Is the code you posted the original FORTRAN code, or is this the True Basic (TB) code as it is after having been converted? It looks like this is FORTRAN.

The code as posted will not run in TB. The main thing to remember about TB code is that NO LINE can begin with a number, unless you have numbered ALL lines, such as with the DO NUMBER routine. If Line Numbers are being used, then ALL lines must start with numbers. If not, then NO line can start with a number.

In the code you posted, TB will give an "illegal line number" error as soon as it sees the line "100 FORMAT(40I2)" because the number "100" is the first thing on that line. Similarly for all the other lines which begin with numbers.

Then, AFTER there are no more leading line numbers, you will then begin to get other errors due to other syntax problems which are in the code. I suspect that this code is the original FORTRAN code.

If you can post the code as it has been converted to TB, I will be glad to have a look at it.

Regards, Mike C.

upgrade to 6.007

when you will upgrade from 6.006 to 6.007 or latest upgrade, may be tou solve this king of problem, mean while I am reading your book in my free times the appendix recommended.

best regards.

Guillermo