Re: [BLACKBOX] output with GP-CP

From: VDI <bernhardt.gunnar{([at]})nowhere.xy>
Date: Wed, 3 Nov 2010 23:02:51 +0100

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

Chris,

thank you for the pointer!

Unfortunately this does not always provide a satisfactory solution,
 especially if you need to format the output.

Take for example the measurement of a (script / small program)
 runtime:

  long timeStart = System.DateTime.Now.Ticks;
  /*
   do something here
  */
  float timeDiff = (System.DateTime.Now.Ticks - timeStart ) /
 (float)System.TimeSpan.TicksPerSecond;
  System.Console.WriteLine( "\ncompleted in {0:F3}s- Enter to quit",
 timeDiff );
  System.Console.ReadLine();

Few people will need a precision of 8 digits in this case, three
 should be enough.

Any ideas how to do this with GP-CP?
I gave up after 2 hours of {trial error}.

kind regards
gunnar

> For an initial attack I'd convert everything to strings before
 outputting
> the message e.g.
>
> (* untested!!! *)
> PROCEDURE HandleError( sender: Sys.Object; args:
> System_Xml_Schema.ValidationEventArgs );
> VAR
> excErr: System_Xml_Schema.XmlSchemaException;
> lineNo, linePos, uri, msg: Sys.String;
> BEGIN
> excErr := args.get_Exception();
> uri := excErr.get_SourceUri();
> lineNo := Sys.Convert.ToString(excErr.get_LineNumber());
> linePos := Sys.Convert.ToString(excErr.get_LinePosition());
> IF args.get_Severity() = System_Xml_Schema.XmlSeverityType.Error
> THEN
> msg := "- -> Error"
> ELSE
> msg := "- -> Warning"
> END;
> msg := msg + " at " + uri + " (" + lineNo + "," + linePos + ")";
> Console.WriteString(msg);
> Console.WriteLn();
>
> Regards,
> Chris Burrows
> CFB Software
> http://www.cfbsoftware.com
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-760466341_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBB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VBvcyA6PSBTeXMuQ29u
dmVydC5Ub1N0cmluZyhleGNFcnIuZ2V0X0xpbmVQb3NpdGlvbigpKTtccGFyDQo+ICAgSUYgYXJn
cy5nZXRfU2V2ZXJpdHkoKSA9IFN5c3RlbV9YbWxfU2NoZW1hLlhtbFNldmVyaXR5VHlwZS5FcnJv
clxwYXINCj4gICBUSEVOIFxwYXINCj4gICAgIG1zZyA6PSAiLSAtPiBFcnJvciJccGFyDQo+ICAg
RUxTRVxwYXINCj4gICAgIG1zZyA6PSAiLSAtPiBXYXJuaW5nIlxwYXINCj4gICBFTkQ7XHBhcg0K
PiAgIG1zZyA6PSBtc2cgKyAiIGF0ICIgKyB1cmkgKyAiICgiICsgbGluZU5vICsgIiwiICsgbGlu
ZVBvcyArICIpIjtccGFyDQo+ICAgQ29uc29sZS5Xcml0ZVN0cmluZyhtc2cpO1xwYXINCj4gICBD
b25zb2xlLldyaXRlTG4oKTtccGFyDQo+IFxwYXINCj4gUmVnYXJkcyxccGFyDQo+IENocmlzIEJ1
cnJvd3NccGFyDQo+IENGQiBTb2Z0d2FyZVxwYXINCj4gaHR0cDovL3d3dy5jZmJzb2Z0d2FyZS5j
b21ccGFyDQo+IFxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2Vu
ZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNU
Uy5PQkVST04uQ0h9fQBQLUNQ
----boundary-LibPST-iamunique-760466341_-_---
Received on Wed Nov 03 2010 - 23:02:51 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:28 UTC