Another simple one
Franks Andy (IT Technical Architecture Manager)
Andy.Franks at sath.nhs.uk
Mon Dec 14 17:25:08 CET 2015
Thanks,
Yeh, I guess it's always be something iterative so a counter starting at zero using expr will be fine.
Cheers
Andy
-----Original Message-----
From: Freeradius-Users [mailto:freeradius-users-bounces+andy.franks=sath.nhs.uk at lists.freeradius.org] On Behalf Of Arran Cudbard-Bell
Sent: 14 December 2015 15:19
To: FreeRadius users mailing list
Subject: Re: Another simple one
> On 14 Dec 2015, at 09:02, Franks Andy (IT Technical Architecture Manager) <Andy.Franks at sath.nhs.uk> wrote:
>
> Hi,
> Did a search for this, can't find an answer, so apologies if it's covered.
>
> FR 3.1.0 latest from git.
>
> Is there any way of getting the index # of the variable I'm looking at in a foreach loop? After doing a sql map (new functionality) I have back a number of rows from a sql DB, and want to reference the index of each variable I'm updating, but I need to know where I'm at in order to do a variable[x] for the other variables that match the one I'm doing a foreach on, if that makes sense.
> If there isn't an easy way, I'll pass the index back from SQL as a field, but it seemed kind of unnecessary if there's a simple way.
No, you'd need to use expr to create a simple counter.
-Arran
Arran Cudbard-Bell <a.cudbardb at freeradius.org> FreeRADIUS development team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
More information about the Freeradius-Users
mailing list