From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73617 Path: news.gmane.org!not-for-mail From: Wagner Macedo Newsgroups: gmane.comp.tex.context Subject: CLD: context.getvariable as Lua variable Date: Thu, 5 Jan 2012 11:49:01 -0300 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1462101896==" X-Trace: dough.gmane.org 1325774983 28462 80.91.229.12 (5 Jan 2012 14:49:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 14:49:43 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 05 15:49:39 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RiodO-0004gk-QR for gctc-ntg-context-518@m.gmane.org; Thu, 05 Jan 2012 15:49:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2AED3CB1C9; Thu, 5 Jan 2012 15:49:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ucQ8NjhlqjcL; Thu, 5 Jan 2012 15:49:32 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E52ABCB1B6; Thu, 5 Jan 2012 15:49:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BFD78CB1B6 for ; Thu, 5 Jan 2012 15:49:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YBA1qjU5BiTy for ; Thu, 5 Jan 2012 15:49:25 +0100 (CET) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id D4171CB1B4 for ; Thu, 5 Jan 2012 15:49:25 +0100 (CET) Original-Received: from mail-iy0-f169.google.com (mail-iy0-f169.google.com [209.85.210.169]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q05EnOo2009019 for ; Thu, 5 Jan 2012 15:49:24 +0100 Original-Received: by iacb35 with SMTP id b35so1314216iac.14 for ; Thu, 05 Jan 2012 06:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=5f4jAVM3Dq22XgSr3cD9+ATa63J6de2MGB9tHFSIziA=; b=pStNjtsYk7XVH9Yg1yM0aCzvo6WwIfaEJk3Z6f/jpdNS5TLxn/1BR1QGojT3zxzblC g3dAxq6/Jv5v50lq39GwmIQyojpxDMI5NYLvyod2+fuiDEiMQMoOrIRPRkLMQobn8hvX lz2NZTJQIuONAsQLHJWtag3eRWt5ZUDfMyLmY= Original-Received: by 10.42.135.69 with SMTP id o5mr2725768ict.34.1325774963636; Thu, 05 Jan 2012 06:49:23 -0800 (PST) Original-Received: by 10.231.117.223 with HTTP; Thu, 5 Jan 2012 06:49:01 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.210.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0HGhONoBL - 2823e3d7b4aa - 20120105 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:73617 Archived-At: --===============1462101896== Content-Type: multipart/alternative; boundary=90e6ba6e836cc277f504b5c909ee --90e6ba6e836cc277f504b5c909ee Content-Type: text/plain; charset=ISO-8859-1 Hello, I'm relatively quite new to TeX world. This is my first message to list. I hope you understand me, English isn't my mother language. I'm trying to use a variable set by \setvariable in Lua. I tried some combinations, based on manual but I couldn't succeed. The code below exemplifies what I wanted to do. \starttext \setvariable{namespace}{var}{Some context} \ctxlua{ local s = context.getvariable("namespace", "var") if s == "" then ... else ... end } \stoptext I know that I can use some of \if* TeX commands, but coding in Lua is better to me. -- Wagner Macedo --90e6ba6e836cc277f504b5c909ee Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I'm relatively quite new to TeX world. This is my first m= essage to list. I hope you understand me, English isn't my mother langu= age.

I'm trying to use a variable set by \setvariable in Lua. I = tried some combinations, based on manual but I couldn't succeed. The co= de below exemplifies what I wanted to do.

\starttext
\setvariable= {namespace}{var}{Some context}
\ctxlua{
=A0 local s =3D context.getvariable("namespace", &qu= ot;var")

=A0 if s =3D=3D "" then
=A0=A0= =A0 ...
=A0 else
=A0=A0=A0 ...
=A0 end
\stoptext

I= know that I can use some of \if* TeX commands, but coding in Lua is better= to me.

--
Wagner Macedo
--90e6ba6e836cc277f504b5c909ee-- --===============1462101896== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1462101896==--