ata ); return; } [i]=(Identifier *) inst [k - 1] .item;
}
* pOp [0] == * pOp [1];
{text [40]; text [0]= 0 raquo ;; (text, % d% s% s , k1, ClassName [1], pOp [0] - gt; text ()); - gt; UpdateRow (k1, text);
}} Desk :: Ind ()//індексне вираз
{k, k1=0; * pOp [0]; op [1] [6]={ op1? }; (int i=0; i lt; 1; i ++) {= numInput (520,170,25,25, op [i]); if (! k1) k1=k; (k lt;=0 || k gt; count) {if (dataError (520,170,25,25)) return; } (inst [k - 1] .classId!=1) {Msg (520,170,25,25, Wrong data ); return; } [0]=(Identifier *) inst [k - 1] .item; * id=new char [5]; (520,170,25,25, Index , id, 2); idx; (! Str2int ( id, idx)) {(520,170,25,25, Wrong data ); id ;;
} id; text [40], out [20]; text [0]= 0 raquo ;; -; (out, Return value is% c , (* (Identifier *) pOp [0]) [idx]); (text, % d% s % s , k, ClassName [2], pOp [0] - gt; text ()); - gt; UpdateRow (k1, out); (); - gt; UpdateRow (k1, text);
}
} Desk :: sbtInd () {// удаленіеk, k1=0; * pOp [3]; op [3] [6]={ op1? , op2? , op3? }; (int i=0; i lt; 3; i ++) {= numInput (520,210,25,25, op [i]); if (! k1) k1=k; (k lt;=0 || k gt; count) {if (dataError (520,210,25,25)) return; } (inst [k - 1] .classId!=2) {Msg (520,210,25,25, Wrong data ); return; } [i]=(Tenstring *) inst [k - 1] .item;
}
* pOp [0]=* pOp [1] - * pOp [2]; text [40]; text [0]= 0 raquo ;; (text, % d% s% s , k1, ClassName [2], pOp [0] - gt; text ()); - gt; UpdateRow (k1, text);
} Desk :: sbtChangeChar () {// представити як чарk=numInput (520,160,25,25, num? ); (k lt;=0 || k gt; count) { if (dataError (520,160,25,25)) return; } (inst [k - 1] .classId!=2) {Msg (520,160,25,25, Wrong data ); return; } * pId=(Tenstring *) inst [k - 1] .item; gt; ChangeChar (); text [40]; text [0]= 0 raquo ;; (text, % d% s% s , k, ClassName [2], pId- gt; text ()); - gt; UpdateRow (k, text);
} Desk :: sbtAssign () {// прісваіваніеk, k1=0; * pOp [2]; op [2] [6]={ op1? , op2? }; (int i=0; i lt; 2; i ++) {= numInput (520,185,25,25, op [i]); if (! k1) k1=k; (k lt;=0 || k gt; count) {if (dataError (520,185,25,25)) return; } (inst [k - 1] .classId!=2) {Msg (520,185,25,25, Wrong data ); return; } [i]=(Tenstring *) inst [k - 1] .item;
}
* pOp [0]=* pOp [1]; text [40]; text [0]= 0 raquo ;; (text, % d% s% s , k1, ClassName [2], pOp [0] - gt; text ()); - gt; UpdateRow (k1, text);
} Desk :: sbtSub () {// сравненіеk, k1=0; * pOp [2]; op [2] [6]={ op1? , op2? }; (int i=0; i lt; 2; i ++) {= numInput (520,210,25,25, op [i]); if (! k1) k1=k; (k lt;=0 || k gt; count) {if (dataError (520,210,25,25)) return; } (inst [k - 1] .classId!=2) {Msg (520,210,25,25, Wrong data ); return; } [i]=(Tenstring *) inst [k - 1] .item;
}
* pOp [0] == * pOp [1]; text [40]; text [0]= 0 raquo ;; (text, % d% s% s , k1, ClassName [2], pOp [0] - gt; text ()); - gt; UpdateRow (k1, text);
} Desk :: numResult (int x, int y, int w, int h, char * s, int k) {// результатlen=strlen (s) +5; * text=new char [len]; (k lt;=99) sprintf (text, % s =% d , s, k); sprintf (text, % s=xxx , s); wt=textwidth (text); ht=textheight (text); +=wt; (x + (w-wt)/2, y + (h-ht)/2, text); (); (x, y, x + w + 1, y + h +1);
} Desk :: dataError (int x, int y, int w, int h) {// ошібкаtext []= Data Error raquo ;; wt=textwidth (text); ht=textheight ( text); +=wt; color=getcolor();(RED);(x,y,x+w,y+h);(x+(w-wt)/2,y+(h-ht)/2,text);(color);ch;ch=getch();(ch!=13amp;amp;ch!=27);(x,y,x+w+1,y+h+1);(ch=27)?1:0;
} Desk :: Msg (int x, int y, int w, int h, char * s) {// собщеніеwt=textwidth (s); ht=textheight (s); +=wt ; (x + (w-wt)/2, y + (h-ht)/2, s); (); (x, y, x + w + 1, y + h + 1);
}//Desk :: str2int (char * str, int amp; result)//переклад в число
{correct=1, minus=0; res=0, i=0; (str [0] == - ) {= 1;=1;
} (str [i] == 0) {0;
} (correct amp; amp; (str [i]!=0)) {((str [i] gt;=0x30) amp; amp; (str [i] lt;=0x39) ) {= res * 10 + (str [i] - 0x30);
} else {= 0;
} ++;
} (correct) {= (minus)? (- res) :( res); 1;
} else {0;
}
} Desk :: numInput (int x, int y, int w, int h, char * prompt) {// чіслоht, wt; text [2]; (BLUE);=textwidth (prompt );=textheight (prompt); +=wt; (x + (w-wt)/2, y + (h-ht)/2, prompt); [0]=getch (); text [1]= 0 raquo ;; (x, y, x + w + 1, y + h + 1);=textwidth ...