Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Edit Macros

Intel_C_Intel
Employee
467 Views
Who have developed a set of macros for the Developer Studio editor for the FORTRAN language (v6.5.0) they like to share?
0 Kudos
2 Replies
Intel_C_Intel
Employee
467 Views
FWIW, sometime (somewhere) in the past, I posted some trivial additions to the MS Samples that added block comment/uncomment to f90 files. You can take a peek here.

hth,
John
0 Kudos
Intel_C_Intel
Employee
467 Views
 
Sub ReduceWidth
'DESCRIPTION: Reduces app. width, maximizes source window, and starts debugging.
w = Application.Width - 580
Application.Left = Application.Left + w
Application.Width = Application.Width - w
ActiveWindow.WindowState = dsWindowStateMaximized
ExecuteCommand "DebugGo"
End Sub
Sub SetWidth()
'DESCRIPTION: Sets the width of each open window to 77 characters and reverse-cascades them.
n = Application.Windows.Count
For Each myW in Application.Windows
If myW.WindowState = dsWindowStateMinimized Then n = n - 1
Next
Application.Top = 25
Application.Height = 900
ActiveWindow.WindowState = dsWindowStateMaximized
x = ActiveWindow.Width - 12
y = ActiveWindow.Height - 25 * n - 11
n = n - 1
ActiveWindow.WindowState = dsWindowStateNormal
l = 675 + 25 * n - x
If l > 0 Then
Application.Left = Application.Left - l
Application.Width = Application.Width + l
End If
t = 0
l = 25 * n
For Each myW in Application.Windows
If myW.WindowState <> dsWindowStateMinimized Then
myW.Top = t
myW.Left = l
myW.Width=670
myW.Height = y
t = t + 25
l = l - 25
End If
Next
End Sub
Sub MakeBanner()
'DESCRIPTION: Inserts a three-line banner, including copyright year, at the top of the file.
TypeOfFile = FileType(ActiveDocument)
If TypeOfFile = 6 Then
CommChr = "'"
ElseIf TypeOfFile = 8 then
CommChr = "!"
End If
ActiveWindow.Selection.StartOfDocument
ActiveWindow.Selection = _
CommChr & String(76, "*") & vbCrLf & _
CommChr & " Copyright (c) " & Year(Now()) & _
" by Company Name Here Your Own Name Here, programmer" & _
vbCrLf & CommChr & String(76, "~") & vbCrLf
End Sub
Sub AddSubr()
'DESCRIPTION: Inserts a Subroutine template at the cursor
p = InputBox("Enter the subroutine name:")
If Len(p) = 0 Then Exit Sub
ActiveWindow.Selection = _
"SUBROUTINE " & p & vbCrLf & _
vbTab & "IMPLICIT NONE" & vbCrLf & vbCrLf & _
"!" & vbTab & "Local Variables in " & p & vbCrLf & vbCrLf & _
"!" & vbTab & "Body of " & p & vbCrLf & vbCrLf & _
"END SUBROUTINE " & p & vbCrLf
End Sub
Sub AddFunc()
'DESCRIPTION: Inserts a Function template at the cursor
p = InputBox("Enter the function name:")
If Len(p) = 0 Then Exit Sub
ActiveWindow.Selection = _
"FUNCTION " & p & "()" & vbCrLf & _
vbTab & "IMPLICIT NONE" & vbCrLf & vbCrLf & _
"!" & vbTab & "Local Variables in " & p & vbCrLf & vbCrLf & _
"!" & vbTab & "Body of " & p & vbCrLf & vbCrLf & _
"END FUNCTION " & p & vbCrLf
End Sub
Sub UpdateBanner
'DESCRIPTION: Updates the copyright year in the three-line banner
Dim Sel
Set Sel=ActiveWindow.Selection
Sel.MoveTo 2, 19
Sel.MoveTo 2, dsEndOfLine, dsExtend
Sel.Text = "-" & Year(Now()) & _
" by Mercury Marine Richard L. Oakland, programmer"
Set Sel=Nothing
End Sub
Sub MyColorPrint
'DESCRIPTION: Runs "ColorPrintCurrent" for each open window
For i = 1 to Application.Windows.Count
ActiveWindow.WindowState = dsWindowStateNormal
ColorPrintCurrent
' Prior to CVF 6.5, the next line was necessary to keep from crashi ng.
' a =MsgBox ("Click OK to continue",vbOKOnly,ActiveDocument.Name)
ActiveWindow.WindowState = dsWindowStateMinimized
Next
End Sub
Sub MinimizeAll
'DESCRIPTION: Minimizes all open windows
For i = 1 to Application.Windows.Count
ActiveWindow.WindowState = dsWindowStateMinimized
Next
End Sub
Sub ColorPrintCurrent
'DESCRIPTION: Removes tabs, does color printing, then replaces tabs
ActiveDocument.Selection.EndOfDocument
ActiveDocument.Selection.StartOfLine dsFirst
0 Kudos
Reply