- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I'm trying to get an integer and a real into my program and the best way would be through a command line argument.
The routines for getting arguments give a character string out.
I've tried doing an internal read of the form
read(argument, fmt ='(i0)') integerargument
but that didn't seem to work.
Can anyone give me a clue how to do this... or even if it's possible.
Thanks
Jeremy
I'm trying to get an integer and a real into my program and the best way would be through a command line argument.
The routines for getting arguments give a character string out.
I've tried doing an internal read of the form
read(argument, fmt ='(i0)') integerargument
but that didn't seem to work.
Can anyone give me a clue how to do this... or even if it's possible.
Thanks
Jeremy
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The easiest way is simply to use free format:
read(argument, fmt=*) integerargument
I think the vairable-width format 'I0' is only valid for output.
read(argument, fmt=*) integerargument
I think the vairable-width format 'I0' is only valid for output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
fantastic, thanks a lot! Why didn't I think of that?
Jeremy
Jeremy
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page