Ремонт принтеров, сканнеров, факсов и остальной офисной техники


назад Оглавление вперед




[10]

(false,

(ta, 0, mkRWRecord(slc, pKeys(tw)), «тгЛ ( (, 0, upd, , , , ))

else (true,

(ta, 0, mkRWRecord(slc, pKeys(tw)),

mkRWTable(slc2, pKeys(tw)),

( (ta2, ka2, upd, slc2, ins2, upd2, del2)) л tl tl acs))

end end

else - - slc =

(false, nothing to do) end end

else - - ~ (len acs > 0) (false, nothing to do) end,

- - PanContent = Text x Nat x RWRecord

--x RWTable x Actions*

add : PanContent - Bool x PanContent add(t, n, rw, tw, acs) =

if len acs > 0

(ta, ka, ua, slc, ins, upd, del) = hd acs - - title, keys, parent update, select, insert, - - update, delete

if ins = then (false,

(ta, 0, mkRWRecord(ins, pKeys(tw)), empty, ( (, 0, upd, , , , )) )) else (false, nothing to do) end end

else (false, nothing to do) end

-- End Of Scheme


Надо отметить, что функция выбора списка первичных ключей из таблицы pKeys(tw, ka) - подразумевает, что в структуре tw из таблицы выбираются первичные ключи текущей строчки,

Завершает уровень не сложные определения оставшихся функций.

-- Start of Scheme

rsl/T0, rsl/L3 CNT0 scheme L3 CNT1 =

with T0 in

extend L3 CNT0 with

class value

exit : PanContent - Unit exit(t, n, rw, tw, acs) =

if rw = empty then skip

elsif len acs = 0 then skip

let (t, k, u, slc, ins, upd, del) = hd acs in

exec(curRec(rw), u) end end,

refresh : PanContent - PanContent refresh(t, n, rw, tw, acs) =

if tw = empty then (t, n, rw, refresh(tw), acs)

else (t, n, rw, empty, acs)

delete : PanContent - PanContent delete(t, n, rw, tw, acs) =

if tw = empty then (t, n, rw, delete(tw), acs)

else (t, n, rw, empty, acs)

- - to make PanContent

mkPanContent : Actions* - PanContent mkPanContent(acs) =

if len acs > 0

let (t, k, pupd, slc, ins, upd, del) = hd acs in

(t, 1, empty, mkRWTable(slc), acs) end

else nothing to do


-- End Of Scheme

2.4.4 Abstract Set Visualization

RWTable и RWRecord обьекты выполняют роль визуализации множества.

2.4.4.1 RWTable Добавим функции работы с окном данных RWTable -- Start of Scheme

rsl/T0, rsl/L3 SETR

scheme L3 SET = with T0 in

extend L3 SETR with

type RWTable

channel setIn : SETInput, setOut : SETOutput

empty : RWTable,

sort : RWTable x Text - RWTable, move : RWTable x SETInput - RWTable,

pKeys : RWTable - Text* , - - to return list of primary keys

curRec : RWTable - Text - Text,

exec : (Text - Text) x Action - Unit, - -

refresh : RWTable - RWTable, delete : RWTable - RWTable,

mkRWTable : Action x Text* - RWTable, - - to make child table mkRWTable :

Action - RWTable - - to make independent table

-- End Of Scheme



[стр.Начало] [стр.1] [стр.2] [стр.3] [стр.4] [стр.5] [стр.6] [стр.7] [стр.8] [стр.9] [стр.10] [стр.11] [стр.12] [стр.13] [стр.14] [стр.15]