Hello all.

I am new to KiXtart scripting so I have a basic question/problem...

First here is the code:

 Code:
If InGroup("Group1")
  $Out = "Forced database to: Kroon Users" 
  $x = WriteLine (9 , $tab + $Out + @CRLF )
  $dbini = ReadProfileString($datafile, "Databases","Group1")
  $basisshare = $datashare + "\map\map1"
EndIf
If InGroup("Group2")
  $Out = "Forced database to: Kroon dealerdatabase"
  $x = WriteLine (9 , $tab + $Out + @CRLF )
  $dbini = ReadProfileString($datafile, "Databases","Group2")
  $basisshare = $datashare + "\map\map2"
  $usergroup = "Usergroup"
  $Force = "CT70"
Else
  $Out = "Forced database to: Kroon Users/Kroon dealerdatabase - No Permissions!!!"
  $x = WriteLine (9 , $tab + $Out + @CRLF )
  $Out = "Rolling back ini update (if any)."
  $x = WriteLine (9 , $tab + $Out + @CRLF )
  $error = WriteProfileString ($userfile, "Stations", $StationUsers[$FirstEmpty,1], " ")
  If $error <> 0
    $Out = "Error writing to " + $userfile + ", quitting script"
    $x = WriteLine (9 , $tab + $Out + @CRLF )
  EndIf
  Goto End
EndIf


As you can see there are 2 IF statements. Now the script doesn't execute as I want it to. Users only member of the Group1 do not connect to the right database because the 2nd IF statement is also executed and because they are not member of Group2 they are forced to End.(because of the Goto End statement.

I have little programming experience and in other languages you could use the ELSEIF statement.
That way there would be more options to use. But in KiXtart the ELSEIF doesn't work...(or I am programming it the wrong way).
Is there another way to handle this problem?
Do I need to use a SELECT here to get the right group for the users?

I hope you understand what I am trying to explain.
Thanks in advance.

Daeseleer


Edited by Daeseleer (2008-08-11 10:22 AM)