From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67378 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \doif... and Lua Date: Fri, 25 Mar 2011 13:25:52 +0100 Message-ID: <56EE34D2-65AD-4DA5-A849-A635B65652E6@googlemail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1301055984 29797 80.91.229.12 (25 Mar 2011 12:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2011 12:26:24 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 25 13:26:20 2011 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 1Q365p-00054F-Sw for gctc-ntg-context-518@m.gmane.org; Fri, 25 Mar 2011 13:26:18 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 89534CAB4F; Fri, 25 Mar 2011 13:26:01 +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 EFXKoLufVh4g; Fri, 25 Mar 2011 13:25:59 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D1F7FCAB28; Fri, 25 Mar 2011 13:25:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 61BBBCAB28 for ; Fri, 25 Mar 2011 13:25:57 +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 TSwHVQC4dIw1 for ; Fri, 25 Mar 2011 13:25:55 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 42FA6CAB26 for ; Fri, 25 Mar 2011 13:25:55 +0100 (CET) Original-Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2PCQ8fT031031 for ; Fri, 25 Mar 2011 13:26:09 +0100 Original-Received: by bwz17 with SMTP id 17so1210343bwz.14 for ; Fri, 25 Mar 2011 05:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=/5jDcrDc5HrsqqYzyaTWtRENpKvKT9E/B7Ch9eI41Bo=; b=oas3hMWIoVsh3Lwlu9+P/w2XepuiklzrxcMHolEKh8HlRdcedSHH5DHhS4qPsPw1WS UFtdpMuFFCbxDGArjTRFRR3Ds65hcUjkBhjO0XOxUlglwaaUCjEAlmA+Fj1czZMXYNjq bbR2o437RDZy50LBFTUBzco0/47I/RahH/XCg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=I99iHHzbzX9jzAy3nx6XlAJS7OogRCSDOtASUD3776s5Xe3rBoT3yV9iC26KV3y7Jd npBDkRzMDxngcpszQ6ZlM5EedQ1XbDZaRwPZDyGZ8QNaK9/cid++4wHMoLagRkvf6emL SlJoyjH5E9fzCBw4c3Y0yhbSGgIMkJKS/S8f4= Original-Received: by 10.204.156.22 with SMTP id u22mr680905bkw.100.1301055968693; Fri, 25 Mar 2011 05:26:08 -0700 (PDT) Original-Received: from [192.168.2.31] (p5B29633E.dip.t-dialin.net [91.41.99.62]) by mx.google.com with ESMTPS id 16sm693211bkm.18.2011.03.25.05.26.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2011 05:26:07 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; 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: 08Enoq8n4 - 36cb7bd30d1c - 20110325 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 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:67378 Archived-At: Am 25.03.2011 um 13:04 schrieb Proch=E1zka Luk=E1=9A Ing. - Pontex s. r. o.: > Hello, > = > is it possible to use a block of context code depending on a value of a L= ua variable? > = > I tried something like: > = > --- > \starttext > \directlua{test =3D true} > %\directlua{test =3D 5} > %\directlua{test =3D "a"} > = > \doifempty{\directlua{return test}} > %\doifempty{\directlua{test}} > {Yes} > {No} > \stoptext > --- > = > But this gives me always "No". > = > - I'm not sure if this is a good way, and whether attempt to use \doif(..= .) macro is a good idea at all. > = > Any (better) solution? \starttext \ctxlua{test =3D true} Test is \ctxlua{commands.testcase(test)}{True}{False}. \ctxlua{test =3D false} Test is \ctxlua{commands.testcase(test)}{True}{False}. \stoptext Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________