simmons
(Lurker)
2004-09-02 01:39 PM
Ingroup Case or If ???

I fell into the Loginscript of someone else and try to understand it:
The Ingroup doesn't work this is the Code:
SELECT
CASE Ingroup ("@Cursus")= 0
$dep="cursist"
CASE Ingroup("@ICT") = 0
$dep="IT Rotterdam"
CASE Ingroup("@ARB") = 0
$dep="Employment & Benefit"
ENDSELECT

the $dep is filled in a kiXtart Form (not the right forum?)

after that it must map to a specific server\share
If $dep = "IT Rotterdam"
Use "F:" "\\IPSAN-RDAM\IT$"
Endif

But the only fill in I get is the last one ($dep=employment) and no mapping is set..
Any clues?
Should I specify $true=0 on top?


Richard H.Administrator
(KiX Supporter)
2004-09-02 01:49 PM
Re: Ingroup Case or If ???

The character "@" has a special meaning, so needs to be doubled up to protect it.

The return value for InGroup is "1" (KiXtart TRUE), not "0" if the user is a member of the group.

This is more like what you want, I think:

Code:

SELECT
CASE InGroup("@@Cursus")
$dep="cursist"
CASE InGroup("@@ICT")
$dep="IT Rotterdam"
CASE InGroup("@@ARB")
$dep="Employment & Benefit"
ENDSELECT




Les
(KiX Master)
2004-09-02 04:43 PM
Re: Ingroup Case or If ???

Why combine CASE and IF and split the tasks between the two? Use CASE when they need to be mutually exclusive and IF when not.