46 lines
926 B
C++
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;
|
|
}
|
|
|