diff --git a/upptst/Mirrors/main.cpp b/upptst/Mirrors/main.cpp index a24f01379..9831f8dcc 100644 --- a/upptst/Mirrors/main.cpp +++ b/upptst/Mirrors/main.cpp @@ -37,20 +37,20 @@ GUI_APP_MAIN r.DrawText(x, y, String(ch, 1) + String(cl, 1), fnt); } r.NewPage(); - for(int i = 0; i < 10; i++) { + for(int i = 0; i < 18; i++) { int a, b; + do { + a = Random(100) + 1; + b = Random(100) + 1; + } + while(a + b < 0 || a + b > 100); + r.DrawText(10, 10 + 3 * isz.cy / 2 * i, Format("%d + %d =", a, b), fnt); do { a = Random(50) + 1; b = Random(50) + 1; } - while(a + b < 0 || a + b > 50); - r.DrawText(10, 10 + isz.cy * 2 * i, Format("%d + %d = ", a, b), fnt); - do { - a = Random(30) + 1; - b = Random(20) + 1; - } while(a - b < 1); - r.DrawText(2000, 10 + isz.cy * 2 * i, Format("%d - %d = ", a, b), fnt); + r.DrawText(2000, 10 + 3 * isz.cy / 2 * i, Format("%d - %d =", a, b), fnt); } Perform(r); } diff --git a/upptst/odbctst/init b/upptst/odbctst/init new file mode 100644 index 000000000..e016cad6c --- /dev/null +++ b/upptst/odbctst/init @@ -0,0 +1,5 @@ +#ifndef _odbctst_icpp_init_stub +#define _odbctst_icpp_init_stub +#include "Core/init" +#include "ODBC/init" +#endif diff --git a/upptst/odbctst/odbctst.cpp b/upptst/odbctst/odbctst.cpp new file mode 100644 index 000000000..7fd2dd760 --- /dev/null +++ b/upptst/odbctst/odbctst.cpp @@ -0,0 +1,21 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + ODBCSession session; + session.Connect("DRIVER=SQL Server Native Client 10.0;SERVER=QUAD\\SQLEXPRESS;DATABASE=Holly;UID=test;PWD=koblih;"); + LOG("Connected!"); + SQL = session; + Sql sql; + sql.Execute("select ID, TEXT, SINCE, TILL from SUBJECT_ATTR where SINCE > ?", Date(2009, 2, 20)); +// sql.Execute("select ID, TEXT, SINCE, TILL from SUBJECT_ATTR where ID > ?", 1700); + while(sql.Fetch()) { + for(int i = 0; i < sql.GetColumns(); i++) { + const SqlColumnInfo& f = sql.GetColumnInfo(i); + LOG(f.name << '=' << sql[i]); + } + } +} + diff --git a/upptst/odbctst/odbctst.upp b/upptst/odbctst/odbctst.upp new file mode 100644 index 000000000..4841c5841 --- /dev/null +++ b/upptst/odbctst/odbctst.upp @@ -0,0 +1,10 @@ +uses + Core, + ODBC; + +file + odbctst.cpp; + +mainconfig + "" = ""; + diff --git a/upptst/odbstst/odbstst.upp b/upptst/odbstst/odbstst.upp new file mode 100644 index 000000000..e69de29bb