Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cheatsheet and new subroutine/function commands. Sent in by jiho.
git-svn-id: http://svn.textmate.org/trunk/Bundles/Fortran.tmbundle@8687 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
- Loading branch information
1 parent
9d1050b
commit 69a6947
Showing
4 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>beforeRunningCommand</key> | ||
<string>nop</string> | ||
<key>command</key> | ||
<string>. "$TM_SUPPORT_PATH/lib/webpreview.sh" | ||
html_header "Fortran Format Cheat Sheet" | ||
Markdown.pl "$TM_BUNDLE_SUPPORT/format_syntax.md" | ||
html_footer</string> | ||
<key>input</key> | ||
<string>none</string> | ||
<key>keyEquivalent</key> | ||
<string>^H</string> | ||
<key>name</key> | ||
<string>Format Cheat Sheet</string> | ||
<key>output</key> | ||
<string>showAsHTML</string> | ||
<key>scope</key> | ||
<string>source.fortran</string> | ||
<key>uuid</key> | ||
<string>46575B73-BDD7-4905-BFCB-2B1C9AA4673D</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
The `'fmt='` specifier in a `read` or `write` statement can give either the line number of a `format` statement, an actual format string or a `*`, for free format. | ||
|
||
# Syntax | ||
|
||
A format specifier is a parenthesized string of format descriptors. | ||
|
||
<table class="pro_table"> | ||
<tr> | ||
<th>Descriptor</th> | ||
<th>Meaning</th> | ||
</tr> | ||
|
||
<tr> | ||
<td>I<em>n</em></td> | ||
<td><em>n</em> positions of integer data</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>F<em>n</em>.d</td> | ||
<td><em>n</em> positions of real data (with d decimal places) — Decimal point form</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>E<em>n</em>.d</td> | ||
<td><em>n</em> positions of real data (with d decimal places) — Exponent form</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>L<em>n</em></td> | ||
<td><em>n</em> positions of logical data</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>A[<em>n</em>]</td> | ||
<td>[<em>n</em> positions of] character data</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><em>n</em>X</td> | ||
<td>skip <em>n</em> horizontal positions (X spaces)</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>\</td> | ||
<td>skip line</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>T<em>c</em></td> | ||
<td>tab to column number <em>c</em></td> | ||
</tr> | ||
|
||
</table> | ||
|
||
Descriptors, or groups of descriptors, can be repeated by prefixing, or parenthesizing and prefixing, with the number of repeats. For example `I4` can be repeated as `2I4` and `I4,1X` as `2(I4,1X)`. | ||
|
||
Plain text strings can be inserted in the format string using double quotes (or two single quotes). | ||
|
||
When the variable cannot be printed entirely given the format specified, it is displayed as placeholders (`'*'` usually) | ||
|
||
# Examples | ||
|
||
NB: ␣ is a space | ||
|
||
write(*,'(i6,i2)') 3, 2 | ||
|
||
␣␣␣␣␣3␣2 | ||
|
||
write(*,'(f10.4,e15.7)') 12.7864, 234.4591 | ||
|
||
␣␣␣12.7864␣␣0.2344591E+03 | ||
|
||
|
||
write(*,'(2x,"record Nº",i2," is ",A6)') 10, 'Philip' | ||
|
||
␣␣record␣Nº10␣is␣Philip | ||
|
||
|
||
write(*,'(2X,2(I4,1X),''name '',A4,F13.5,1X,E13.5)') 77778, 3, 'ABCDEFGHI', 14.45, 15.5666666 | ||
|
||
␣␣\*\*\*\*␣␣␣␣3␣name␣ABCD␣␣␣␣␣14.45000␣␣␣0.15567E+02 | ||
|
||
|