campo-sirio/src/sc/sc1600.cpp
mtollari 1b14ec9415 Spostamento cartella sorgenti
git-svn-id: svn://10.65.10.50/branches/R_10_00@23236 c028cbd2-c16b-5b4b-a496-9718f37d4682
2016-09-09 13:59:02 +00:00

46 lines
926 B
C++

#include <applicat.h>
#include <progind.h>
#include <recset.h>
#include <relation.h>
#include "../cg/cgsaldac.h"
class TCheckClosed : public TSkeleton_application
{
public:
virtual void main_loop();
};
void TCheckClosed::main_loop()
{
TISAM_recordset part("USE PART SELECT (CHIUSA!=\"X\")&&(NUMRIG<\"9999\")");
const TRectype& rec = part.cursor()->curr();
const TRecnotype games = part.items();
TProgress_monitor pi(games, title());
TRecnotype found = 0;
for (bool ok = part.move_first(); ok; ok = part.move_next())
{
if (!rec.get_bool(PART_CHIUSA))
{
TPartita p(rec);
if (p.chiusa(true))
{
p.rewrite();
found++;
}
}
if (!pi.add_status())
break;
}
message_box(FR("Sono state allineate %ld partite chiuse"), found);
}
int sc1600(int argc, char** argv)
{
TCheckClosed a;
a.run(argc, argv, TR("Controllo partite chiuse"));
return 0;
}