forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Window updating from a Namelist

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
cmenchini



Joined: 11 Oct 2004
Posts: 2

PostPosted: Thu Oct 14, 2004 9:43 am    Post subject: Window updating from a Namelist Reply with quote

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
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 169
Location: Manchester

PostPosted: Wed Oct 20, 2004 4:03 am    Post subject: Window updating from a Namelist Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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