Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

newline

sandwich
Beginner
683 Views
print *, "123
456"
results in
 123
456

but i want
123
456

how can easily get this, is there a compiler option?
of course i could use
print *, "123", "n456"

but i don't like this.
0 Kudos
9 Replies
Steven_L_Intel1
Employee
683 Views
Isn't that an ugly feature?! -vms will get you what you want. In 8.0, this recognition will be off by default and there will be a new switch to turn it on if you want it.

Steve
0 Kudos
sandwich
Beginner
683 Views
thanks! (but:)

ugly?: yes. and funny:
program backslash
print *, ""
end program

compiling gives (an error message twice as long as the program):
   program BACKSLASH

print *, ""
          ^
Warning 18 at (2:backslash.f90) :  used as an escape character is an extension to standard Fortran 95
            ^
Error 5 at (2:backslash.f90) : incomplete string

1 Error
compilation aborted for backslash.f90 (code 1)

i didn't want to use it as an escape character! ;-)

!!! unfortunately this message remains when compiling with -vms !!! ???

i use:
Intel Fortran Compiler for 32-bit applications, Version 7.1   Build 20030701Z
Copyright (C) 1985-2003 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

GNU ld version 2.13.90.0.2 20020802
  Supported emulations:
   elf_i386
   i386linux
   elf_i386_glibc21
0 Kudos
TimP
Honored Contributor III
683 Views
ifc -nbs sandwich.f90
program BACKSLASH

3 Lines Compiled
tim@linux:/windows/E/src/net> ./a.out


Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030412Z

FOR NON-COMMERCIAL USE ONLY
GNU ld version 2.13.90.0.2 20020802
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21
0 Kudos
TimP
Honored Contributor III
683 Views
correction (sorry, cut and paste problem):

GNU ld version 2.11.90.0.29 (with BFD 2.11.90.0.29)
0 Kudos
Steven_L_Intel1
Employee
683 Views
As Tim suggests, add -nbs. This too won't be needed in 8.0. (Grumble - I hate it when Fortran implementors think they're writing a C compiler instead...)

Steve
0 Kudos
sandwich
Beginner
683 Views
yes, now it works.

thank you both.

yes, i also like C, but i would appreciate that people are able to distinguish.

greetings,

sandwich
0 Kudos
sandwich
Beginner
683 Views
i have to correct:

as seen in the example below i could not use
print *, "123"
.
0 Kudos
Steven_L_Intel1
Employee
683 Views
Why not? What happens? It seems to work for me with -vms and -nbs specified.

Steve
0 Kudos
sandwich
Beginner
683 Views
no, i meant without these options (my first message).
0 Kudos
Reply