From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 8281229740 for ; Wed, 29 May 2024 16:34:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E4BC5484BFE for ; Wed, 29 May 2024 16:32:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=gmail.com Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JnqPfkIsP0A for ; Wed, 29 May 2024 16:32:14 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4AB584846E9 for ; Wed, 29 May 2024 16:31:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2E8784844A5 for ; Wed, 29 May 2024 16:30:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wL7oD94X2h1P for ; Wed, 29 May 2024 16:30:55 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.218.51; helo=mail-ej1-f51.google.com; envelope-from=wolfgang.schuster.lists@gmail.com; receiver= Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id A92E7481034 for ; Wed, 29 May 2024 16:30:55 +0200 (CEST) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a59cc765c29so150849366b.3 for ; Wed, 29 May 2024 07:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716993055; x=1717597855; darn=ntg.nl; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=4JRtc1uBDQLRhcsdhZ/q0kgdZAxZOrnbx44FkI7SJ4w=; b=UC6rqx+MsqN7ITqMGWZUJpSYkGSAXMH+PGFHIWaLLTxpPqOLZ8AqxmDTvnwfUl09dt O5O89dHP9tIpc2NOEMOWLQvWdi5U+//JjwhBk+ebhPFVqCHJdF2xoAYILCtLrDPU0g9n 9RKYU+3MmdNbaHKVOWMkIfXwL10GnzSCPfGgpBJAqKySkB0l9gi8UR8926RyASTtQlYz NhW3ccGgrJrOIA9D0f72h5PG4sjQN7Gwa8fb/trOaiVm6ZKq/xLoZsqSgmDz6qJ7UsM+ px5xhSJ/ohKSxCylW4gkt80o0XDENBqoQgk4SSVbTESVq8CZMVRpilLxzqxHZCJ/xVY/ Oorw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716993055; x=1717597855; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4JRtc1uBDQLRhcsdhZ/q0kgdZAxZOrnbx44FkI7SJ4w=; b=ZKrNWumDoARfdblTS7OeyW+6FkJCFTkhn3e4tB5Xxqt4Nnh9mnGB/ZXyA19iwGuZgU f/bFyJeQCmEEf8Bm43aC2tyA3cqOczZK55JuMz+Ek34VM3s5wnP6R+opRrEy+vlKJOPP 7R1zxJtWz9FSVaoxatrWjdvPbN0iVG/C5S851iA9FyEgQFLQgw0I0WjjQZhOVdo9gh0L YIr41CSWmTm1pVHJ3vRtdU60TIAyHhFnW5GdGn+EYkHBonN7C9iRRdz0puf9dq1f5y+G c/7HcKba2GNfaGfT0UQhTzhCcumwyQt3JTf5Sg4VQkFACAy3EVa+8msaY7Jk9XrO71Es Mu6w== X-Gm-Message-State: AOJu0Yx3EjZYjsRF0+w0WAkwjNgmstxHN/VvA6OE83TBt6ASBcp4UwiT JqSlXLNJhktyL9o0WWQ+7bAJaH5v4kcxVXSmcQSGpHXCAd+n89u0CzXkYg== X-Google-Smtp-Source: AGHT+IEPvFVVomW8bP52tIpj8XV1HbmosVxkJOVxTLdDqYhrCwpk2w6T0tmytxaWR2Zx2Ze9RK4m+Q== X-Received: by 2002:a17:906:a287:b0:a59:cb29:3fb3 with SMTP id a640c23a62f3a-a6265148babmr1054662966b.53.1716993054833; Wed, 29 May 2024 07:30:54 -0700 (PDT) Received: from ?IPv6:2a02:810d:a8bf:dc10::7141? ([2a02:810d:a8bf:dc10::7141]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda60bdsm725153966b.207.2024.05.29.07.30.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2024 07:30:54 -0700 (PDT) To: mailing list for ConTeXt users , ai2472206007@yeah.net References: <171698432131.1996.6583951499689676818@cgl.ntg.nl> From: Wolfgang Schuster Message-ID: Date: Wed, 29 May 2024 16:30:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.60 MIME-Version: 1.0 In-Reply-To: <171698432131.1996.6583951499689676818@cgl.ntg.nl> Content-Language: en-US Message-ID-Hash: 2QN3U2MQBCSBOOUUVU6WZRYH4OOYXUY3 X-Message-ID-Hash: 2QN3U2MQBCSBOOUUVU6WZRYH4OOYXUY3 X-MailFrom: wolfgang.schuster.lists@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit ai2472206007@yeah.net schrieb am 29.05.2024 um 14:05: > I'm defining a command to generate options for multiple choice questions, > but at the moment I'm stuck at this step. > I want to get a number and assign a value to the counter, but why can't I get it? > > %%%% > \starttext > \definedataset [myset] > \setdataset [myset] [foo=1,boo=4] > \newcount\tempa > \datasetvariable{myset}{1}{boo} % definitely get 4 > %\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa? > %\number\tempa > \stoptext > %%%%% > > If anyone can fix it, thanka very much You have to add a check to ensure there is a value stored in the aux-file before you pass the value to the counter. This is necessary because when you process the document for the first time Context only saves the value and can access it only in the next run after. %%%% begin example \definedataset [myset] \starttext \setdataset [myset] [foo=1,boo=4] \doifelsesomething{\datasetvariable{myset}{1}{boo}} {\scratchcounter\datasetvariable{myset}{1}{boo}} {\scratchcounter\zerocount} boo = \number\scratchcounter \stoptext %%%% end example Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________