RE: Storing Dialogs to a file

From: Martin, Marc <"Martin,>
Date: Mon, 30 Jun 2003 13:21:02 -0700

----boundary-LibPST-iamunique-285676151_-_-
Content-type: text/plain

>Anyway, I am still in the dark concerning how to store Dialogs
>to disk.

I wasn't paying attention to the start of this thread, so
I've probably completely misunderstood the question here,
but I've been storing my dialogs to disk by just using
simple file I/O. I've included an example of what I do
below. I suspect that this is NOT what you're asking about,
because what I'm doing here is very simple.

Marc Martin
marc.martin{([at]})nowhere.xy

----------------

(* parameters for dialog box "ClientSettings" *)

  clientSettings*: RECORD
    showDisplay*, showAnimation*: BOOLEAN;
    fdfSitename*, fdfUsername*, fdfPassword*: Lib.Str256;
  END;


(* write the contents of this dialog box to disk *)


PROCEDURE WriteClientSettings( loc: Files.Locator; name: Files.Name );
VAR
  f: Files.File;
  w: Stores.Writer;
  res: INTEGER;
BEGIN
  f := Files.dir.New(loc, Files.dontAsk);
  w.ConnectTo(f);
  w.WriteBool ( clientSettings.showDisplay );
  w.WriteBool ( clientSettings.showAnimation );
  w.WriteString( clientSettings.fdfSitename );
  w.WriteString( clientSettings.fdfUsername );
  w.WriteString( clientSettings.fdfPassword );
  f.Register( name, "odc", Files.dontAsk, res );
  ASSERT( res = 0 );
END WriteClientSettings;


(* read the contents of this dialog box from disk *)


PROCEDURE ReadClientSettings( loc: Files.Locator; name: Files.Name );
VAR
  f: Files.File;
  r: Stores.Reader;
BEGIN
  f := Files.dir.Old( loc, name, TRUE );
  ASSERT( f # NIL );
  r.ConnectTo(f);
  r.ReadBool ( clientSettings.showDisplay );
  r.ReadBool ( clientSettings.showAnimation );
  r.ReadString( clientSettings.fdfSitename );
  r.ReadString( clientSettings.fdfUsername );
  r.ReadString( clientSettings.fdfPassword );
  f.Close;
END ReadClientSettings;
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-285676151_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID5Bbnl3YXksIEkgYW0gc3RpbGwgaW4gdGhlIGRh
cmsgY29uY2VybmluZyBob3cgdG8gc3RvcmUgRGlhbG9ncyBccGFyDQo+dG8gZGlzay4gXHBhcg0K
XHBhcg0KSSB3YXNuJ3QgcGF5aW5nIGF0dGVudGlvbiB0byB0aGUgc3RhcnQgb2YgdGhpcyB0aHJl
YWQsIHNvXHBhcg0KSSd2ZSBwcm9iYWJseSBjb21wbGV0ZWx5IG1pc3VuZGVyc3Rvb2QgdGhlIHF1
ZXN0aW9uIGhlcmUsXHBhcg0KYnV0IEkndmUgYmVlbiBzdG9yaW5nIG15IGRpYWxvZ3MgdG8gZGlz
ayBieSBqdXN0IHVzaW5nXHBhcg0Kc2ltcGxlIGZpbGUgSS9PLiAgSSd2ZSBpbmNsdWRlZCBhbiBl
eGFtcGxlIG9mIHdoYXQgSSBkb1x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dGhlIGxpc3Qgc2VydmVyIHdpbGwgcmVj
b2duaXplIHlvdSBhcyBzdWJzY3JpYmVyIGFuZCBmb3J3YXJkIHlvdXIgcG9zdGluZyBpbW1lZGlh
dGVseSwgd2l0aG91dCBjcmVhdGluZyBhbnkgb3ZlcmhlYWQuXHBhcg0KXHBhcg0KYikgSWYsIGZv
ciBzb21lIHJlYXNvbiwgeW91IGNhbm5vdCBwb3N0IGZyb20gdGhlIGFkZHJlc3MsIGJ5IHdoaWNo
IHlvdSBhcmUgc3Vic2NyaWJlZCwgeW91ciBtZXNzYWdlIHdpbGwgYmUgbW9kZXJhdGVkIHRvIGF2
b2lkIHNwYW0uIFBsZWFzZSB1bmRlcnN0YW5kIHRoYXQgbW9kZXJhdGlvbiB3aWxsIG9mdGVuIGNh
dXNlIHNvbWUgZGVsYXksIGluIHBhcnRpY3VsYXIgb3ZlciB3ZWVrZW5kcyBvciBob2x5ZGF5fX0A
aGUgcXVl


----boundary-LibPST-iamunique-285676151_-_---
Received on Mon Jun 30 2003 - 22:21:02 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:10 UTC