[NTG-context] Re: Question about building an array of values with Lua

2023-08-25 Thread Fabrice Couvreur
Hi Wolfgang, Thank you so much Fabrice Le jeu. 24 août 2023 à 19:46, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Otared Kavian schrieb am 24.08.2023 um 12:50: > > > On 24 Aug 2023, at 06:03, Wolfgang Schuster < > wolfgang.schuster.li...@gmail.com> wrote: > > […] > > > I

[NTG-context] Re: Question about building an array of values with Lua

2023-08-24 Thread Wolfgang Schuster
Otared Kavian schrieb am 24.08.2023 um 12:50: On 24 Aug 2023, at 06:03, Wolfgang Schuster > wrote: […] I would drop the column check in this case.     for i = 0,9 do     context.startxrow()     context.startxcell()    

[NTG-context] Re: Question about building an array of values with Lua

2023-08-24 Thread Otared Kavian
> On 24 Aug 2023, at 06:03, Wolfgang Schuster > wrote: >> […] > > I would drop the column check in this case. > > for i = 0,9 do > context.startxrow() > context.startxcell() > context(i) > context.stopxcell() >

[NTG-context] Re: Question about building an array of values with Lua

2023-08-24 Thread Fabrice Couvreur
Hi Otared and Wolgang, Thanks for the answers. In fact, being familiar with Python and not at all with Lua, I didn't have the reflex to think of using a mathematical function which gives the remainder in the Euclidean division by 10, it's strange !! Fabrice Le jeu. 24 août 2023 à 04:06, Wolfgang

[NTG-context] Re: Question about building an array of values with Lua

2023-08-23 Thread Wolfgang Schuster
Otared Kavian schrieb am 24.08.2023 um 01:04: Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a

[NTG-context] Re: Question about building an array of values with Lua

2023-08-23 Thread Otared Kavian
Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a completed version of what Wolfgang sent: %% begin

[NTG-context] Re: Question about building an array of values with Lua

2023-08-23 Thread Wolfgang Schuster
Fabrice Couvreur schrieb am 23.08.2023 um 19:28: Hi, I'm trying to fill an array using lua. So far it works but then I don't know if it's possible. Where do you have problems (look into cld-mkiv.pdf for hins)? \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont =