- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I been looking at the fortwan_winprint.f90 example and it contains USE ONLY statements.
In my programs I have only used USE statements.
Is the only reason for using the ONLY statement is to stop the clash of subroutine names.
Or does using the ONLY statement speed up compilation time, reduce execution time, or make a smaller executable file?
Thanks,
David
In my programs I have only used USE statements.
Is the only reason for using the ONLY statement is to stop the clash of subroutine names.
Or does using the ONLY statement speed up compilation time, reduce execution time, or make a smaller executable file?
Thanks,
David
コピーされたリンク
9 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
As far as I can remember from the documentation, USE ONLY certainly speeds up compilation. But I use it every time because I find it a very useful way of documenting which routines & constants have been imported from what modules into my source code.
Regards
Alan
Regards
Alan
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
ONLY does speed compilation, especially with very large modules, and I also like the documentation issue.
Steve
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I have been going through my code changing USE to USE ONLY.
I find in some places I have to replace USE dfwin with USE dfwin, ONLY : WM_HELP,WM_INITDIALOG, etc.
In other places where WM_HELP & WM_INITDIALOG are used I can remove USE dfwin completely and it compiles OK - I am not using any other USE statements.
Any ideas why this occurs ?
Thanks,
David
I find in some places I have to replace USE dfwin with USE dfwin, ONLY : WM_HELP,WM_INITDIALOG, etc.
In other places where WM_HELP & WM_INITDIALOG are used I can remove USE dfwin completely and it compiles OK - I am not using any other USE statements.
Any ideas why this occurs ?
Thanks,
David
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Got IMPLICIT NONE?
The WM_ symbols are defined in DFWINTY, which is implicitly used by all of the various DFWIN modules. If you aren't using IMPLICIT NONE, then the symbols are undeclared variables and get default typing - probably not what you want.
Steve
The WM_ symbols are defined in DFWINTY, which is implicitly used by all of the various DFWIN modules. If you aren't using IMPLICIT NONE, then the symbols are undeclared variables and get default typing - probably not what you want.
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I haven't used IMPLICIT NONE - but in Project Settings - Compilation Diagnostics, I have ticked undeclared symbols.
I'm still confused.
Dsvid
I'm still confused.
Dsvid
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
How about posting a short example that doesn't use USE statements? I'm interested in seeing it. Do you USE any other modules that USE DFWIN and friends?
Steve
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
It's my mistake.
I was sometimes using a "USE MyModule" which I hadn't realised included a USE dfwin.
Thanks,
David
I was sometimes using a "USE MyModule" which I hadn't realised included a USE dfwin.
Thanks,
David
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Ok - thought it might be something like that.
I strongly suggest that in your modules you use ONLY clauses, and/or use PRIVATE and then make PUBLIC only the symbols you want to export. ONLY is better than PRIVATE for restricting module namespaces, from the compiler's viewpoint, however. (Both is fine!)
Steve
I strongly suggest that in your modules you use ONLY clauses, and/or use PRIVATE and then make PUBLIC only the symbols you want to export. ONLY is better than PRIVATE for restricting module namespaces, from the compiler's viewpoint, however. (Both is fine!)
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I replaced my "Use dfwin" with "use dfwin, only:" and found compilation time INCREASED from 10 to 24 minutes.
So I have just gone back to how it was before.
David
So I have just gone back to how it was before.
David
