Another simple one

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Dec 14 16:18:59 CET 2015


> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20151214/906662cf/attachment.sig>


More information about the Freeradius-Users mailing list