ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Dirty trick
@ 2006-03-22 15:08 Antoine Junod
  2006-03-23 11:04 ` Dirty trick / clean solution Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Antoine Junod @ 2006-03-22 15:08 UTC (permalink / raw)


Hello list,

I've got a piece of code that is absolutely
aful. Unfortunately (sic) it makes what I want.

\defineparagraphs[p][n=2,before={},after={}]
\setupparagraphs[p][1][width=.2\textwidth,style=bold]

\definetyping
  [code]
\setuptyping
  [code]
  [margin=.23\textwidth,before={},after={\vskip-10pt}]

\startp Operation: \p AuctionClient::providePersData($p$:
Person)\stopp
\startp Description: \p Fournit les données personnelles
nécessaires à la création d'un compte, encapsulées dans un
objet $p$.\stopp
\startp Messages: \p{\tt auctionServer\^{}createAccount(p:
Person);}\stopp\startcode
sender^message(msg: String);
sender^requestPersData()
\stopcode
\startp Pre: \p {\tt true}\stopp
\startp Post: \p{\tt  if
(self.checkPersData(p))}\stopp\startcode
then
  self.auctionServer.createAccount(p) and
  not(sender.message('Malformed personal data')) and
  not(sender.requestPersData())
else
  not(auctionServer^createAccount(p)) and
  sender^message('Malformed personal data') and
  sender^requestPersData()
endif
\stopcode
\blank

How could I improve that? I've tried a lot of different
things but the main problem is that i can't type in verbatim
mode because i'm in reduced horizontal mode.

Thanks a lot for you help
-AJ

p.s.: the whole tests documents are there:

  http://www.tots-ns.net/tests/conception/test.tex
  http://www.tots-ns.net/tests/conception/test.pdf
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dirty trick / clean solution
  2006-03-22 15:08 Dirty trick Antoine Junod
@ 2006-03-23 11:04 ` Hans Hagen
  2006-03-23 11:10   ` Antoine Junod
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2006-03-23 11:04 UTC (permalink / raw)


Antoine Junod wrote:
> Hello list,
>
> I've got a piece of code that is absolutely
> aful. Unfortunately (sic) it makes what I want.
>
> \defineparagraphs[p][n=2,before={},after={}]
> \setupparagraphs[p][1][width=.2\textwidth,style=bold]
>
> \definetyping
>   [code]
> \setuptyping
>   [code]
>   [margin=.23\textwidth,before={},after={\vskip-10pt}]
>
> \startp Operation: \p AuctionClient::providePersData($p$:
> Person)\stopp
> \startp Description: \p Fournit les données personnelles
> nécessaires à la création d'un compte, encapsulées dans un
> objet $p$.\stopp
> \startp Messages: \p{\tt auctionServer\^{}createAccount(p:
> Person);}\stopp\startcode
> sender^message(msg: String);
> sender^requestPersData()
> \stopcode
> \startp Pre: \p {\tt true}\stopp
> \startp Post: \p{\tt  if
> (self.checkPersData(p))}\stopp\startcode
> then
>   self.auctionServer.createAccount(p) and
>   not(sender.message('Malformed personal data')) and
>   not(sender.requestPersData())
> else
>   not(auctionServer^createAccount(p)) and
>   sender^message('Malformed personal data') and
>   sender^requestPersData()
> endif
> \stopcode
> \blank
>
> How could I improve that? I've tried a lot of different
> things but the main problem is that i can't type in verbatim
> mode because i'm in reduced horizontal mode.
>
> Thanks a lot for you help
> -AJ
>   
\starttext

\definedescription[procedure]  [width=10em]
\definedescription[operation]  [procedure]
\definedescription[description][procedure]
\definedescription[post]       [procedure]

\setupdescriptions[operation]  [title=no,text=Operation]
\setupdescriptions[description][title=no,text=Description]
\setupdescriptions[post]       [title=no,text=Post]

\definetyping[code][before=\vskip-\lineheight,after=]

\startoperation
AuctionClient::providePersData($p$: Person)
\stopoperation

\startdescription
Fournit les données personnelles
nécessaires à la création d'un compte, encapsulées dans un
objet $p$.
\stopdescription

\startpost
\startcode
if (self.checkPersData(p)) then
  self.auctionServer.createAccount(p) and
  not(sender.message('Malformed personal data')) and
  not(sender.requestPersData())
else
  not(auctionServer^createAccount(p)) and
  sender^message('Malformed personal data') and
  sender^requestPersData()
endif
\stopcode
\stoppost

\stoptext

please wikify this

(i'll make the title keyword inheritable)

Hans

-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dirty trick / clean solution
  2006-03-23 11:04 ` Dirty trick / clean solution Hans Hagen
@ 2006-03-23 11:10   ` Antoine Junod
  0 siblings, 0 replies; 3+ messages in thread
From: Antoine Junod @ 2006-03-23 11:10 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

> Antoine Junod wrote:
> > Hello list,
> >
> > I've got a piece of code that is absolutely
> > aful. Unfortunately (sic) it makes what I want.
> >
> > \defineparagraphs[p][n=2,before={},after={}]
> > \setupparagraphs[p][1][width=.2\textwidth,style=bold]
> >
> > \definetyping
> >   [code]
> > \setuptyping
> >   [code]
> >   [margin=.23\textwidth,before={},after={\vskip-10pt}]
> >
> > \startp Operation: \p AuctionClient::providePersData($p$:
> > Person)\stopp
> > \startp Description: \p Fournit les données personnelles
> > nécessaires à la création d'un compte, encapsulées dans un
> > objet $p$.\stopp
> > \startp Messages: \p{\tt auctionServer\^{}createAccount(p:
> > Person);}\stopp\startcode
> > sender^message(msg: String);
> > sender^requestPersData()
> > \stopcode
> > \startp Pre: \p {\tt true}\stopp
> > \startp Post: \p{\tt  if
> > (self.checkPersData(p))}\stopp\startcode
> > then
> >   self.auctionServer.createAccount(p) and
> >   not(sender.message('Malformed personal data')) and
> >   not(sender.requestPersData())
> > else
> >   not(auctionServer^createAccount(p)) and
> >   sender^message('Malformed personal data') and
> >   sender^requestPersData()
> > endif
> > \stopcode
> > \blank
> >
> > How could I improve that? I've tried a lot of different
> > things but the main problem is that i can't type in verbatim
> > mode because i'm in reduced horizontal mode.
> >
> > Thanks a lot for you help
> > -AJ
> >   
> \starttext
> 
> \definedescription[procedure]  [width=10em]
> \definedescription[operation]  [procedure]
> \definedescription[description][procedure]
> \definedescription[post]       [procedure]
> 
> \setupdescriptions[operation]  [title=no,text=Operation]
> \setupdescriptions[description][title=no,text=Description]
> \setupdescriptions[post]       [title=no,text=Post]
> 
> \definetyping[code][before=\vskip-\lineheight,after=]
> 
> \startoperation
> AuctionClient::providePersData($p$: Person)
> \stopoperation
> 
> \startdescription
> Fournit les données personnelles
> nécessaires à la création d'un compte, encapsulées dans un
> objet $p$.
> \stopdescription
> 
> \startpost
> \startcode
> if (self.checkPersData(p)) then
>   self.auctionServer.createAccount(p) and
>   not(sender.message('Malformed personal data')) and
>   not(sender.requestPersData())
> else
>   not(auctionServer^createAccount(p)) and
>   sender^message('Malformed personal data') and
>   sender^requestPersData()
> endif
> \stopcode
> \stoppost
> 
> \stoptext
> 
> please wikify this

I'll as soon as possible. Thanks a lot for your help.
-AJ
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-23 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-22 15:08 Dirty trick Antoine Junod
2006-03-23 11:04 ` Dirty trick / clean solution Hans Hagen
2006-03-23 11:10   ` Antoine Junod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).