Returning an error if the #include is not found.

 

Hi all,

Quick question, is there a way to return an error message in the event that an #include file is not found in the EA (i.e. in the event that the file has not been saved in the correct directory or a function has been called to a non-existent #include file), like a FileIsExist() function but for #include files?

All the best, 

 
TheHonestPrussian: Hi all, Quick question, is there a way to return an error message in the event that an #include file is not found in the EA (i.e. in the event that the file has not been saved in the correct directory or a function has been called to a non-existent #include file), like a FileIsExist() function but for #include files? All the best, 

It already does that. "#include" works at compile-time (not run-time) and an error is given during compilation when the file is not found. You will NEVER get this at run-time, because the included file is compiled into the final executable.

Don't confuse "#include" with resources. For resources, you can also use the "#resource" command to embed the resource into the executable at compile-time.

EDIT: Also, please note that "#include" may sometimes be used with executable libraries or external DLL files, but that is something else. Is that what you are referring to?

 
Fernando Carreiro #:

It already does that. "#include" works at compile-time (not run-time) and an error is given during compilation when the file is not found. You will NEVER get this at run-time, because the included file is compiled into the final executable.

Don't confuse "#include" with resources. For resources, you can also use the "#resource" command to embed the resource into the executable at compile-time.

I see that this runs on compile mode, just wondered is there was a function that is the location of the file returned FLASE, a MessageBox() would ping up and say "Oi, No Include file!" or words to that effect! But as it only runs in compile-time mode, then I see this is impossible :)

Much appreciated :) 

Reason: