ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Ajith R <ajithramayyan@yahoo.co.in>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: metafun transformation error
Date: Fri, 4 Jun 2021 15:08:48 +0000 (UTC)	[thread overview]
Message-ID: <2090794061.1155729.1622819328604@mail.yahoo.com> (raw)
In-Reply-To: <3a356e83-2349-6269-c803-48c57cef9757@xs4all.nl>

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

Hi,


> here a ; is missing after the q

That was a silly mistake while making the MWE. 
When I corrected it, the MWE compiled correctly. However, the original code didn't have that error and wouldn't compile.
So, I tried another MWE and found out what was causing the error.
In the array I defined, there were two elements with empty string as their value. Once I changed those empty strings to some valid string, there was no error and the file compiled as expected. Here is the new MWE with one array element defined as empty string

\starttext
\switchtobodyfont[30pt]
\startMPpage
StartPage ;
unit := 2 * cm ;
%numeric lm, row, col, bm; 
pair  middle;
row := 1; col := 1; 
picture p, q ; p := nullpicture; q := nullpicture;


string l[], lbl;
l[0] := "" ; l[1]:= "2"; 


for i= 0 upto row:
middle := 0.5[((( i * unit) ), ((2 * unit))), ((((i+1) * unit) ), ((2 * unit) ))];
lbl := l[i];
p := thelabel(lbl, middle); 
q := p reflectedabout (0.5[urcorner p, ulcorner p], 0.5[lrcorner p, llcorner p]);
draw q;


endfor
StopPage ;
\stopMPpage
\stoptext


This will throw an error. If l[0] is defined as, say, "hi", there is no error

I suppose, my work around would be to use a non empty string and then fill that cell dark. Is there another way?

Anyway, thanks for your prompt replies and patience.

Thanks a ton for sharing your efforts with the world

ajith

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: errortest.tex --]
[-- Type: text/x-tex, Size: 512 bytes --]

\starttext
\switchtobodyfont[30pt]
\startMPpage
StartPage ;
unit := 2 * cm ;
%numeric lm, row, col, bm; 
pair  middle;
row := 1; col := 1; 
picture p, q ; p := nullpicture; q := nullpicture;

string l[], lbl;
l[0] := "" ; l[1]:= "2"; 

for i= 0 upto row:
middle := 0.5[((( i * unit) ), ((2 * unit))), ((((i+1) * unit) ), ((2 * unit) ))];
lbl := l[i];
p := thelabel(lbl, middle); 
q := p reflectedabout (0.5[urcorner p, ulcorner p], 0.5[lrcorner p, llcorner p]);
draw q;

endfor
StopPage ;
\stopMPpage
\stoptext


[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-06-04 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <561884252.127404.1622754117330.ref@mail.yahoo.com>
     [not found] ` <561884252.127404.1622754117330@mail.yahoo.com>
2021-06-04  8:15   ` Ajith R
2021-06-04  9:22     ` Hans Hagen
2021-06-04 11:25       ` Ajith R
2021-06-04 12:27         ` Hans Hagen
2021-06-04 15:08           ` Ajith R [this message]
2021-06-04 15:28             ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2090794061.1155729.1622819328604@mail.yahoo.com \
    --to=ajithramayyan@yahoo.co.in \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).