From the course: Introduction to Fortran

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Compiler error messages: Typos in user defined names

Compiler error messages: Typos in user defined names - FORTRAN Tutorial

From the course: Introduction to Fortran

Compiler error messages: Typos in user defined names

- [Instructor] We give names to all sorts of things in our programs. They're how we refer to those things. You get to decide what those names are, but they have to be spelled exactly the same any place they're used. Make a typo, and the compiler will get confused. Let's take a look at some examples of names that we can misspell, and the errors that they might produce. On the right hand side we have an example program, our hello world program, but I've misspelled the name of the program on the first line. Let's see what happens when we try to compile this. We get error, expected label, hello, misspelled, for end program statement at one. So it's telling us that the error that it's getting is at line three, but we misspelled the name on line one. Well, because this is a user defined name, the compiler assumes that whatever we put here, is the name we meant. And so it expected to find the same name at the end program…

Contents