Hello and welcome my name is Paul
Laidler. This video is about Plato and in
particular a new feature called Auto
compilation.
I'm also going to look at one or two
other things on the way. For the new
feature you will need Plato version 5.3
and FTN95 version 8.62 and these can
be downloaded via a link from the Silverfrost Forum. Let's start with the
clipboard ring. Plato automatically
remembers what you put on the clipboard
and you can paste from that history by
pressing alt + V.  Suppose for example I
copy a number of different items, maybe
these three lines. Just copy them with
ctrl + C. Now right-click. If I select
paste from clipboard history or use
Alt + V then I get a list of the history
of recent items that have
been copied to the clipboard and I can
paste any one of those by double
clicking on that line. If it's a large
amount on the clipboard then you'll just
get the beginning of what appears in
that saved item. The clipboard history is
stored in the clip library
and you can see it here marked as the
clip ring and that's the content that
you'll find. Moving on to highlighting
Fortran structures in the text. If I go
to the settings dialog and select
miscellaneous then there's an item here
called highlight matching Fortran do/end do.
When that's selected the effect
is that, when we click on the beginning
of a line that begins a Fortran
do structure, then the beginning and
end are highlighted with bold and
underlined. Click on the next line then
under the beginning of that do or the
end of that do and beginning and end are
highlighted. The same is true for if-then
structure beginning or the end and the
whole is highlighted in that way. And all
of the Fortran structures have this
highlighting feature that can be
selected and used to make it easier to
read the text. All right let's move on to
this main feature of auto compilation. We have an
example program here ready for you. Again
it's necessary to switch this feature on
from the settings dialog
and this time it's auto compile FTN95
code and at moment is selected to be off.
You can select it to be on or with
different delays. I'm going to select it
with one second and that will switch on the
auto compilation and the effect of
that is for Plato to begin a
conversation with FTN95 compiler which
is running in the background. And Plato
will take a copy, in my case every
second, take a copy of the code and
send it to the compiler. The compiler
will report back if and when it
encounters a programming error and it
only reports the first error for you
to use. Take for example this line
here
just to illustrate the idea. I could
delete that bracket and see what the
effect is. Then there is a delay because
of the 1 second pause but there is a
report of an error shown first of
all by a red box around that line and
then an icon appears. And when I hover
over that icon I get the reported error
that comes up as a tooltip. And here it
is "unpaired left bracket" as you'd expect.
So I can put that back in and to make it
correct again. Notice that that bracket
is highlighted in blue anyway and the
corresponding opening bracket appears.
This not only true for that but of
course also for nested brackets. Here the
closing back is highlighted with
opening bracket. Here in this one a
highlight appears and finally the
innermost one, the highlight appears.
That also it has to be
switched on and you'll find the setting
is in text editor and general. 
"highlight matching bracket" So I switch
that on. Let's have a look at another
example. Suppose I delete this R to see
what the effect is of that. Well it comes up with a error report "variable
name expected after comma" and so that
trailing comma is not permitted. I
can for example delete it. Now that leads to
revealing another error which is
reported here when I hover. "R must appear
in a type declaration because implicit none
has been used". Incidentally that
same error appears down below it in the
status bar. As we look at the code we
find there is an "implicit none" and so
with that R must be declared. And so
we'll put it back to make the code right
again. Now the idea is that, as we begin to write programs and type in new
code, there will be that automatic
interaction with the compiler giving you
a status report and report any
compilation errors that are encountered
on the way. In the end we will normally
continue to do an explicit compile, build
and run using, in my case here I'm using
this build toolbar which is selected
from the view menu.
So there we have the basic idea and it
is quite a powerful way to work. If we
have a look at a different example will
find that this time the error is that
compiler can't find a definition for the
module. Now I've chosen to comment that
module out just to illustrate that we do
need the module what Plato will do
and what FTN95 in cooperation with the Plato
will create a temporary module when
that's present. So here if I put back those three lines then the module is
actually present in the code and the
compiler will find the temporary copy of
the module and use it in the compilation.
So that that doesn't interfere with
anything else that you might want to do
in the normal way,
that copy for the automatic compilation
is just a temporary copy and
it's not kept for anything other
than this auto compilation. That means
that if that module happens to occur in
a different file then you need to access
that file first to create the temporary
copy of the module and then everything
works. When you come back to this file it
would be found in its temporary location.
So that illustrates the basic idea. Just
one point to add and that is that I
haven't used a project here. I've chosen
just to have a simple file with direct
compilation and for that situation there
is an option to add extra FTN95
options on the command line. And here
I've added
/fpp for conditional compilation which I
don't actually need. But you might need
something like that or you might need a
"wide source" command something which is
required for that particular file. And
you can provide that in this dialog.
And that can stay open or closed at
will whichever you prefer and the
options which appear there, that would
need to be used in this auto compilation,
will be copied across and used by
the compiler.
So that illustrates the main ideas
behind this auto compilation and I
certainly recommend that you give it a
try because you might find that it could
be very powerful and very useful for you. So now let's
move on and we're going to go on now to
this illustration of debugging.
We go back to this program to for  illustration and for
my demonstration again, going back to the
Tools menu and settings, we find that
we have the option to integrate Plato with the debugger. And when that
option is selected Plato works directly with the debugging code
and in the case of a 64-bit executable
(when running for 64-bits) the debugging
code is actually built directly
into Plato and copied from the source
for the SDBG debugger. So that being
selected now means, when I start to
run a debugging session, it will work
directly with Plato itself.
So here I've selected a debug option. I
could also use Checkmate. Both of those
have debug features in them and the
code when compiled can be run directly
now from Plato. So when we start
that up we find that the debugging
session has stopped at the first
executable line. There is a window that
shows the local variables. Also 
the call stack comes up automatically,
and using these buttons on the toolbar,
you can step over. If there's a
subroutine we can step into a subroutine
or out of a subroutine. And you need to
step in that way, looking at the code.
Here we're calculating the value of an array
which is an array of complex numbers. We
find that the values appear as we hover
over a variable and you'll find the values
appear in a tooltip. But down here in the
locals window we could add an extra
watch window to watch
particular variables. That could be added either directly by
double-clicking to give a new box
with the variable in it.
Or we can right-click and add to the
watch variables that can be stored here
separately in the Watch window. So let's just double click on N here.
You see that just the first value of N has been
completed already the others have not
been evaluated yet.
There's no checkmate on so there is no undef
value set, but the one that has
been calculated is shown. We can continue
to step at one line at the time and
notice that the values appear and are updated
as you go. We could, for example, stop the
debugging and maybe right click on
the mouse. Maybe go straight to
that point via "run to cursor". That starts
the debugger and goes directly to that
particular point. We could select another
line and toggle a breakpoint on that
line and then run to that breakpoint. We
could also look at all the breakpoints
in the list. There's a breakpoint on line
15. You can also, as well as using this
toggle breakpoint,  we could as an
alternative use the Ctrl + Shift key. If
you hold down Ctrl + Shift and then
click on that symbol on the icon then
that has the effect of toggling the
breakpoint as well. So I'll Shift + Ctrl
click and that places new breakpoint at
that point
and then we can run to the breakpoint as
before. In addition to that we have other
possibilities. And if you really want to
you can look up the registers and see
what's happening at the register level.
Or you can look at the assembly code and
see how that's working. So all of these
features you can get by running the
debugger separately and independently
but almost all of the features available
in the debugger directly
are available from Plato itself in
that way. So eventually we will simply
stop the debugger and continue with our
development.
Notice that breakpoints will be remembered for
the next session if you want to keep
them. So that illustrates a number of new
features and most importantly this auto
compilation which could well be a
very useful feature for you. So I
encourage you to have a look at Plato
if you don't already use it and to have
a go at using these features and to see
if you can take advantage of them.
Well that's all for now and thank you
for listening.
Goodbye.
