Files correlati : si0.exe Ricompilazione Demo : [ ] Commento : MOdulo personalizzazioni Ass. Agricoltori di Ravenna git-svn-id: svn://10.65.10.50/trunk@9968 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			79 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| //////////////////////////////////////////////////////////////
 | |
| // Stampa documenti
 | |
| //////////////////////////////////////////////////////////////
 | |
| 
 | |
| #include <applicat.h>
 | |
| #include <config.h>
 | |
| #include <defmask.h>
 | |
| #include <form.h>
 | |
| #include <msksheet.h>
 | |
| #include <printer.h>
 | |
| #include <progind.h>
 | |
| #include <sheet.h>
 | |
| 
 | |
| #include "si0200.h"
 | |
| 
 | |
| class TAggart_application: public TSkeleton_application
 | |
| {
 | |
| 
 | |
| protected:
 | |
|   virtual bool create();
 | |
|   virtual bool destroy();
 | |
|   virtual void main_loop();
 | |
|   virtual const char * extra_modules() const { return "BA"; }
 | |
| 
 | |
| public:
 | |
|   TAggart_application()  {};
 | |
|   virtual ~TAggart_application() {};
 | |
| };
 | |
| 
 | |
| inline TAggart_application& app() { return (TAggart_application&) main_app(); }
 | |
| 
 | |
| bool TAggart_application::create()
 | |
| {
 | |
|   return TSkeleton_application::create();
 | |
| }
 | |
| 
 | |
| bool TAggart_application::destroy()
 | |
| {
 | |
|   return TApplication::destroy();
 | |
| }
 | |
| 
 | |
| void TAggart_application::main_loop()
 | |
| {             
 | |
|   TRelation * r = new TRelation(LF_ANAMAG);
 | |
|   TCursor c(r); 
 | |
|   const long items = c.items();
 | |
|   
 | |
|   for (c = 0L; c.pos() < items; ++c)
 | |
|   {
 | |
|     TRectype & rec = c.curr();
 | |
|     TString descr = rec.get("DESCRAGG");  
 | |
|     descr.trim();
 | |
|     if (descr.not_empty())
 | |
|     {
 | |
|       const int p= descr.find("ST/");
 | |
|       if (p > 0)
 | |
|       {             
 | |
|         TString stampo(descr.mid(p+3));
 | |
|         rec.put("USER2", stampo);
 | |
|         descr.cut(p);
 | |
|       }
 | |
|       else
 | |
|         rec.put("USER2", "");
 | |
|       rec.put("USER1", descr);
 | |
|       rec.put("DESCRAGG", "");
 | |
|       rec.rewrite(r->lfile());
 | |
|     }
 | |
|   }
 | |
| }
 | |
| 
 | |
| // Do all the work!
 | |
| int si0300(int argc, char* argv[])
 | |
| {
 | |
|   TAggart_application a;
 | |
|   a.run(argc, argv, "modifica descr");
 | |
|   return (0);
 | |
| }
 | |
| 
 |