Re: Nearly there with wxEuphoria and wxIDE

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...

This is what I have for check_file_modified():

export procedure check_file_modified( integer the_file ) 
	sequence stat = dir( file_list[the_file] ) 
	if compare( stat[1][D_YEAR..D_SECOND], file_last_modified[the_file] ) = 1 then 
		-- been modified! 
		integer reload = message_box(  
			sprintf("[%s] has changed since it was last viewed.  Would you like to reload it from disk?",  
				{ file_short_list[the_file] }), 
			"File Changed On Disk", 
			wxYES_NO ) 
		 
		if reload = wxYES then 
			reload_ok = 1 
			load_file( file_list[the_file] ) 
		else 
			-- don't bug the user again 
			file_last_modified[the_file] = stat[1][D_YEAR..D_SECOND] 
		end if 
			 
	end if 
end procedure 

[matt: added eucode tags]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu