COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### control the write not to next line

• Email
• Follow

I found two ways to control the write command not to next line.
But I am puzzled of "\".
So somebody can explain what "\" does when write command is
executing.

program main
implicit none
integer a, b
a = 1
b = 2
write(*, '(I3,\)')a
write(*, '(I3)')b
write(*, '(I3)')b
end program


 0
Reply leed2005 (11) 1/8/2008 12:38:04 PM

See related articles to this posting

In message
leed <leed2005@gmail.com> writes
>I found two ways to control the write command not to next line.
>But I am puzzled of "\".
>So somebody can explain what "\" does when write command is
>executing.
>
>program main
>implicit none
>integer a, b
>a = 1
>b = 2
>write(*, '(I3,\)')a
>write(*, '(I3)')b
>write(*, '(I3)')b
>end program

It suppresses the final carriage-return and/or line-feed.  This was
never part of Standard Fortran, but a backslash, or more commonly, a
dollar, as a format item was a moderately common extension to Fortran77
compilers.  Now that ADVANCE='NO' is available and fully portable, these
other things ought to die out.

--
Clive Page

 0
Reply junk2470 (76) 1/8/2008 1:16:51 PM

On 1$B7n(B8$BF|(B, $B2<8a(B9$B;~(B16$BJ,(B, Clive Page <j...@main.machine> wrote: > In message > <7102fc43-3876-48d7-b0bc-2090a0de3...@j78g2000hsd.googlegroups.com>, > leed <leed2...@gmail.com> writes > > > > >I found two ways to control the write command not to next line. > >I know the "advance" is advance feature after f90. > >But I am puzzled of "\". > >So somebody can explain what "\" does when write command is > >executing. > > >program main > >implicit none > >integer a, b > >a = 1 > >b = 2 > >write(*, '(I3,\)')a > >write(*, '(I3)')b > >write(*, '(I3)', advance='no')a > >write(*, '(I3)')b > >end program > > It suppresses the final carriage-return and/or line-feed. This was > never part of Standard Fortran, but a backslash, or more commonly, a > dollar, as a format item was a moderately common extension to Fortran77 > compilers. Now that ADVANCE='NO' is available and fully portable, these > other things ought to die out. > > -- > Clive Page Thank you for your explanation.   0 Reply leed2005 (11) 1/9/2008 2:01:04 AM Clive Page wrote: (snip) > It suppresses the final carriage-return and/or line-feed. This was > never part of Standard Fortran, but a backslash, or more commonly, a > dollar, as a format item was a moderately common extension to Fortran77 > compilers. Now that ADVANCE='NO' is available and fully portable, these > other things ought to die out. Well, that assumes a file system that uses CR or LF as line terminators. Otherwise, the system has to buffer the data such that multiple WRITEs go to one record on output. I believe the$ went back at least to DEC Fortran 66 compilers.
It was especially useful for prompts for interactive input.

-- glen


 0
Reply gah (12850) 1/10/2008 7:00:28 AM

3 Replies
95 Views

Similar Articles

12/12/2013 4:23:49 PM
[PageSpeed]

Similar Artilces:

next line, new line
I have a lot of SQL to convert to postgres from oracle. I have most of the problems worked out except for this last bit. Many of my tables need the last comma replaced with a close parenthesis - they look like this: create table schema.table ( FLD000 NUMERIC(10,0) NOT NULL, FLD001 CHAR(3) NOT NULL, FLD002 DATE NOT NULL, ; when the syntax requires: FLD002 DATE NOT NULL) ; I output the text in reverse thinking I could find the semicolon, go to the next line and replace the 'comma newline' with 'closeparen newline' and then go on to find the next semicolon. ; FLD002 DATE NOT ...

Write to SpreadSheetFile line by line?
Hello, I want to write recorded strings to an .txt-file. How do I get a line-feed? Appending "\n" does not work. Any idea? Thanks Nico Are you sure that you're actually sending the control cod and not the characters "/" and "n". If you're using string constant/control, right click and make sure "/" Codes Display is selected. The other thing you can do is use the line feed constant on the string palette. Also, depending on the platform you're on and the program you're using to read the file, you might need to write a carriage return or ...

Remove a line if next line is blank
Hi , I have a problem i have a log analyzer that print's info for some hosts(logins etc) .For example Analysis on xxx.xxx.xx **LOGIN** from ... **LOGIN** from ... **LOGIN** from ... Analysis on yyy.yyy.yy **FAILED** from .... **FAILED** from .... **FAILED** from .... Analysis on zzz.zzz.zz Analysis on www.www.ww Analysis on ccc.ccc.cc Analysis on aaa.aaa.aa As you can see , i try to make a script that remove those hosts who don't have logs .I wan't to see only hosts that have logs .I try to delete the "Analysis on .." line for every host if that host does not have...

How to skip first 5 lines and process next 8 lines
I am a awk newbie. I want to skip the first 5 lines. Then I want to process the next 8 lines and skip all records remaining. Please can you kindly share the code for the same. Thanks Karen On 2005-09-08, karenmiddleol@yahoo.com wrote: > I am a awk newbie. > > I want to skip the first 5 lines. Then I want to process the next 8 > lines and skip all records remaining. awk 'NR <= 5 { next } NR > 13 { exit } { ## process lines 6 to 13 here }' -- Chris F.A. Johnson <http://cfaj.freeshell.org> ===================...

Can't get labview to write continiously to spreadsheet, writes one column each time program is run, then appends data the next time it is run.
I am attempting to write load cell, linear transducer and time stamp to EXCEL. Due to the limited room in EXCEL I have a sample rate of 10/second. This is accomplished by setting the DAQ assistant to one sample (HW timed) in the acquisition mode of the task timer. A wait timer set at a loop rate of&nbsp;1000 millaseconds is included in the "while" loop to slow the sampling rate down. This works well. Now the data is taken outside of the loop and entered into a "build array" block and then into a "write to spreadsheet" block. This generates only one row of&...

avoiding to write last line
hi! i have an awk script that deletes new lines and stuff like that, here: BEGIN{ FS =3D "=A3" RS =3D"=A3$" ORS=3D"=A3" } { gsub(/\\\n/," ") gsub(/\n^ /," ") gsub(/\r/, " ") print } END{ } My problem now is: at the end of the file there is an empty line and because of the ORS the empty line is not really empty and writes a =A3. I don't want this last =A3 in my file. How can I eliminate this? if (!EOF) print ?! chrishunnell@gmail.com wrote: > hi! > > i have an awk script that deletes new lines and stuff like that, ... Pointer line control problem Dear SAS-L, I have a macro to do some report output and have line pointer control problem like the following(seems numeric-variable doesn't work): 1---the follwing codes works,and output like: column1 line1 column2 line1 column1 line2 column2 line2 column1 line3 filename out 'c:\temp\wrap test.txt'; data _null_; file out print ; /* do index=1 to 10; col='column1 line'||trim(put(index,2.)); put #index @1 col @; end; do index=1 to 5; col='column2 line'||trim(put(index,2.)); put #index @30 col @; end;*/ ... Controlling Webget from the command line (webget@ping.demon.co.uk is reported as an 'unrouteable address', so appealing to expertise of newsgroup in general:) Is it possible to specify to Webget on the command-line a list of arbitrary single links to be fetched (e.g. via a text file containing web page addresses), rather than using the desktop interface to specify a 'front-page' URL from which a whole site is to be retrieved? Alternatively, what would be the syntax to get it to treat a local HTML file rather than a remote URL as the 'front page', and get all the links it finds there? -- Harriet Bazley ... add text to next line? Hello, I am trying to find <body> in an html file and then add some text to the line after the <body> tag ... the code below adds the text at the end of the file. How do I get the text on the next line after <body>? Cheers geoff use warnings; use strict; use File::Find; my$dir = 'd:/a-winfiles/mfox/html/few'; find sub { my $name =$_; if (-d $_) {return;}; if ($name !~ /^print/) { open (IN, "$name"); my$line; while (defined ($line = <IN>)) { if ($line =~ /<body>/i) { open (...

Controlling no of lines for text area input
Is there a way I can control the number of lines a user enters in a textarea? I like to allow user to enter let say 5 lines and no more than that. Thanks in advance. <effendi@epitome.com.sg> wrote in message news:1108427514.540279.78830@z14g2000cwz.googlegroups.com... > Is there a way I can control the number of lines a user enters in a > textarea? I like to allow user to enter let say 5 lines and no more > than that. > > Thanks in advance. It's more practical to work in terms of the number of characters rather than lines. The .value.length property of the textare...

Printing will not wrap to the next line.
Hi all, When I submit a document (that contains lines of 80 characters or more) to a printer, it doesn't wrap to the next line. What can I do it make the printer wrap the characters to the next line...instead of them disappearing into the ether? Any help would be greatly appreciated. Thanks, trub3101 trub3101 wrote: > Hi all, > > When I submit a document (that contains lines of 80 characters or more) > to a printer, it doesn't wrap to the next line. > > What can I do it make the printer wrap the characters to the next > line...instead of them disappearin...

Find the next control in the tab order
Hi All, >From an event handler attached to a control that has a tab index, is it possible to find the next control in the tab order - and then focus() on it? I am having a bit of trouble with running my own (onkeyup) code in response to a tab and then making sure that the tab-effect still occurs i.e. focus on the next control in the tab order isn't happening even though I return true from the function. Rob :) > possible to find the next control in the tab order - and then focus() > on it? The easiest way I can think of is: 1. Use the taborder attribute 2. Get the taborder fo...

Write line longer then 1024 character
Hi, I have small problem, I am trying to write to the ascii file the line, which its lenght is N (to make it easier lets assume array(145,132) - for sure more than 1024) characters. write(8,'(132(145f10.3))') ((array(i,j),i=1,145),j=1,132) I try to do it on Cray with fortran 90. Does anyone know any tricks to do it ? Regards, Roman "Roman" <janrom1@yahoo.com> wrote in message news:50b3b8b.0311060802.119322ee@posting.google.com... > Hi, > I have small problem, I am trying to write to the ascii file the line, > which its lenght is N (to make it easier lets as...

Re: Putting controls next to graphics in the
Use Grid to approximate what you want. If you want it closer, you can build it up in a Grid with individual uses of Control rather than using Manipulate. f[x_] = (x + 2) (x - 2); Grid[{{Manipulate[ Plot[f[x], {x, -5, 5}, PlotRange -> {-25, 50}, Epilog -> {Red, Line[{{x0, -25}, {x0, 50}}], Line[{{-5, y0}, {5, y0}}]}], {{x0, 0, "x"}, -5, 5, .1, Appearance -> "Labeled"}, {{y0, 0, "y"}, -25, 50, 1, Appearance -> "Labeled", ControlType -> VerticalSlider}, ControlPlaceme...

Controlling a command-line program for Windows
Has anyone run into a situation where you had to do that? This comes up again and again for me and each time I search for a solution, I always hit a dead-end. Expect was great for Unix.... but I keep coming back to Pexpect and see that it doesn't work with Windows. Some people have tried Popen2, but that's not the way. If someone who has gone down this path could enlighten us, it would be greatly appreciated. Samples of what you would use it for include: SSH, controlling ftp, or essentially basic scripting for any interactive commandline tools. Hoang Do ...

controlling grid lines in JTable header
Does anybody know how to control the grid lines in a JTable header? Thanks. mitch wrote: > Does anybody know how to control the grid lines in a JTable header? > Thanks. > What do you mean by 'controlling'.. Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager __________________________________________________________________________ 'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-) mitch wrote: > Does anybody know how to control the grid lines in a JTab...

How to control arrow placement on section line?
Which setting controls where the arrow is placed relative to the section line in SW2005 when choosing Insert>Drawing View>Section? I want the arrows pointing away from the section line with the leader running from the arrow tail to the section line. What I have now are arrows pointing to the section line with the arrow tips locked to the section line. Thanks, Pedro change your Tools, Options, Document setting, to ANSI instead of ISO... Hope that helps Steve T. <iinventedpants@hotmail.com> wrote in message news:1151720509.525099.96920@m73g2000cwd.googlegroups.com... > Which s...

Excel writing; next empty cell
Greetings all! I have a program that calculates out several values and I want to write them to an Excel data sheet. However, I do not want the data to be overwritten. This is to be a log, so every time the program runs it needs to write to the next blank row. The solutions I have seen are all for a single program run, and if you run the program again it overwrites the data from the previous run. A program that starts writing at A1 or similar is not what I am looking for. So I am looking for a solution that will look into the Excel file I am writing into and determine what column is the firs...

write data in cell on multi lines
Hello, I would like to write timeseries (x's) data in cells on multi lines as follows: format: Time x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 dataset: 1.00 0.0000 0.0000 0.0000 0.0000 0.0000 0.9992 0.0025 0.0055 0.0090 0.0010 0.1761 0.0999 0.1970 0.0890 1.9320 0.0000 0.0000 2.6000 12.3000 0.0000 0.0000 0.0000 35.00 0.0000 0.0000 ...

Re: Moving to the next line #3
Thank you for your help on this Howard and Roland! I did try it in my program as below. Howard, I'm not sure if I'm integrating your method correctly. I included a little larger section of my data below. I'm getting some other numbers and I also do get some leading and trailing periods in the rows. Your suggestions are appreciated. Best regards, Tom FILENAME indat1 "G:\data.txt"; FILENAME outdat1 "G:\pi_001_est.txt"; DATA one (KEEP = pi_001); FILE outdat1 MOD; INFILE indat1 LRECL=32000 TRUNCOVER ; INPUT @ 'Final estimation of fixed effects: (Population-...