|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
cmenchini
Joined: 11 Oct 2004 Posts: 2
|
Posted: Thu Oct 14, 2004 9:43 am Post subject: Window updating from a Namelist |
|
|
I was wondering if someone could give me a quick answer to a simple problem I'm having. I'm evaluating the personal edition in hopes of purchasing the Pro for my company.
I am having trouble in figuring out how to update a simple string and edit input box (%rs and %rd, respectively) that I create using the winio@ function from a function that reads in a namelist. I have put call window_update@ functions everywhere it seems, and nothing seeems to update the edit boxes. I would just like to be able to click on the read namelist file option in the file drop down menu and have the edit boxes for %rs and %rd refresh from the namelist inputs. Any suggestions? Thanks in advance for any help
Here is the program:
***************************************************
program update
use mswin
winapp
character(len=20) casename
integer i, winio@, gui_restart, num_procs
logical restart
namelist/precrunch/ casename,restart,num_procs
external read_pc
casename = 'test'
restart = .true.
gui_restart = 0
procs = 10
i=winio@('%mn[&File[Read Namelist File,E&xit]]&',read_pc,'EXIT')
i=winio@('Casename: %rs%ff&',casename)
i=winio@('Restart: %rd%ff&',gui_restart)
i=winio@('No of Processors: %rd',procs)
end program update
integer function read_pc()
namelist/precrunch/ casename,restart,procs
character(len=20) casename
integer gui_restart
logical restart
open (unit=10,file="precrunch.inp",STATUS="UNKNOWN")
read (10,precrunch)
close(10)
if (restart) then
gui_restart = 1
else
gui_restart = 0
endif
read_pc=1
end function read_pc
******************************************************
And here is precrunch.inp:
******************************************************
&PRECRUNCH
casename = "bob"
restart = F
procs = 8
/
****************************************************** |
|
Back to top |
|
|
silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Wed Oct 20, 2004 4:03 am Post subject: Window updating from a Namelist |
|
|
Here is a version that works:
Code: |
program update
use mswin
winapp
character(len=20) casename
integer i, winio@, procs,irestart,read_pc
logical restart
common casename,restart,procs
namelist/precrunch/ casename,restart,procs
equivalence(restart,irestart)
external read_pc
casename = 'test'
restart = .true.
gui_restart = 0
procs = 10
i=winio@('%mn[&File[Read Namelist File,E&xit]]&',read_pc,'EXIT')
i=winio@('Casename: %rs%ff&',casename)
i=winio@('Restart: %rd%ff&',irestart)
i=winio@('No of Processors: %rd',procs)
end program update
integer function read_pc()
integer procs
logical restart
common casename,restart,procs
namelist/precrunch/ casename,restart,procs
character(len=20) casename
integer gui_restart
open (unit=10,file="precrunch.inp",STATUS="UNKNOWN")
read (10,precrunch)
close(10)
!$$$$$$ if (restart) then
!$$$$$$ gui_restart = 1
!$$$$$$ else
!$$$$$$ gui_restart = 0
!$$$$$$ endif
read_pc=1
end function read_pc
|
------------
Administrator
Silverfrost Forums |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|