----boundary-LibPST-iamunique-556727422_-_-
Content-type: text/plain
Wojtek,
Bottom line. Its a poor design.
By the way, you needn't copy dynamically created records since you can
always dereference a pointer. I just tried the following example and it
works. Notice the embedded pointer within the top level record. The
fields of the associated form are Foo.p.byte and Foo.p.p.byte and they
are updated correctly.
MODULE Foo;
IMPORT Dialog;
TYPE
P* = POINTER TO R;
R* = RECORD
byte*: BYTE;
p*: P;
END;
VAR
p*: P;
PROCEDURE Update*;
BEGIN
p.byte := 6;
p.p.byte := 11;
Dialog.Update(p^)
END Update;
BEGIN
NEW(p);
NEW(p.p);
END Foo.
skulski{([at]})nowhere.xy
> Doug:
>
> It is more than you wrote. Dialog works with statically defined records,
> while OOP design paradigm works best with dynamically allocated records.
> The usual OOP paradigm is to define an Abstract Data Structure as a
> POINTER TO RECORD, and then to instantiate such structures dynamically.
> One can then make arrays of structures, linked lists of structures,
> and so forth. Unless I am missing something obviuous, Dialog does not
> display such dynamical structures. Nor does it display stack objects,
> that is structures declared locally in a procedure. Dialog only works
> with "interactors", that is statically declared records at a module
> global level.
>
> In my own DAQ programs I copy the data from my "objects" (i.e., dynamically
> created structures) to interactors, and then I call Dialog.Update. In my
> GUI commands I do the opposite: at the end of every command I copy the
> relevant data back from the interactor to the object. The premise being
> that the user has modified the interactor data, and then pressed a button
> that the command is attached to.
>
> I do not see a simple workaround, but I also do not see a pressing need
> for such a workaround. It takes some getting used to, and it works
> well. I am not sure I understand why we should not just get used to the
> fact that this is the way Dialog works.
>
> W.
>
>
>
>>Folks,
>>The module Dialog exports the following update functions
>>
>> PROCEDURE Update (IN interactor: ANYREC);
>> PROCEDURE UpdateList (IN interactor: ANYREC);
>> PROCEDURE UpdateBool (VAR b: BOOLEAN);
>> PROCEDURE UpdateInt (VAR i: INTEGER);
>> PROCEDURE UpdateLInt (VAR l: LONGINT);
>> PROCEDURE UpdateReal (VAR r: REAL);
>>
>>There are no Updates for
>>
>>2. SHORTCHAR the characters of the Latin‘1 character set (0X .. 0FFX)
>>3. CHAR the characters of the Unicode character set (0X .. 0FFFFX)
>>4. BYTE the integers between MIN(BYTE) and MAX(BYTE)
>>5. SHORTINT the integers between MIN(SHORTINT) and MAX(SHORTINT)
>>8. SHORTREAL the real numbers between MIN(SHORTREAL) and MAX(SHORTREAL),
>>the value INF
>>10.SET the sets of integers between 0 and MAX(SET)
>>
>>This seems(?) to necessitate 'copying' those data types to a record,
>>rec, and then calling Update(rec). That is inefficient and violates
>>the following principle.
>>
>>GUI PRINCIPLE
>>Any module M should be displayable in a form F via a module D without
>>copying any fields of M into D.
>>
>>Can this principle be realized in BlackBox? If not why not?
>>
>>If one must copy then F must reference both M and D which seems unclean
>>(or all displayed exports of M must be copied to D and then only D is
>>referenced in F).
>>
>>It copying can be avoided then F can reference the M data directly and
>>only the guards and notifiers need reside in D. This would provide a
>>clean separation of disciplines.
>>
>>-Doug Danforth
>>
>>--- BlackBox
>>--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>>
>>
>
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
>
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-556727422_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZn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