#62393 - 2002-01-25 03:50 PM
turn around @userid
|
Conn TS
Lurker
Registered: 2002-01-25
Posts: 4
Loc: IJsselmuiden
|
I'd like the $gwname to use the first letter of the firstname and the rest should be the lastname. For example Rick van de Poll should be "rpoll". The @Userid we use is turned as PollR. has anyone an idea? $gwnaam=SUBSTR("@FULLNAME", LEN("@FULLNAME")-15, 1) $gwnaam=$gwnaam + SUBSTR("@USERID", LEN("@USERID")-1, 15)
|
|
Top
|
|
|
|
#62395 - 2002-01-25 04:03 PM
Re: turn around @userid
|
New Mexico Mark
Hey THIS is FUN
  
Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
|
@UserID returns the Windows NT user ID. This is not a 'calculated' value, but simply what was assigned to the domain.If your naming convention is consistent, you could simply do the following: $gwnaam = substr(@userid,len(@userid),1) + substr(@userid,1,len(@userid)-1) If not, you might be able to do the following: $ary=Split(@FULLNAME) $gwnaam=SubStr($ary[0],1,1) + $ary[ubound($ary)] New Mexico Mark
|
|
Top
|
|
|
|
#62396 - 2002-01-25 04:11 PM
Re: turn around @userid
|
Conn TS
Lurker
Registered: 2002-01-25
Posts: 4
Loc: IJsselmuiden
|
i'm sorry. I'm using v. 3.62
|
|
Top
|
|
|
|
#62397 - 2002-01-25 04:15 PM
Re: turn around @userid
|
DrillSergeant
MM club member
   
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Don't worry, as long as you're using Kix, you're welcome on this board  try one of these: ; * Example with FullName$last=@FULLNAME while instr($last,' ') $last=substr($last,instr($last,' ')+1,len($last)) loop $gwnaam=lcase(substr(@FULLNAME,1,1)+$last) ? $gwnaam
or ; * Example with UserID$gwnaam=lcase(substr(@USERID,len(@USERID),1)+substr(@USERID,1,len(@USERID)-1)) ? $gwnaam
HTH [ 25 January 2002: Message edited by: DrillSergeant ]
_________________________
The Code is out there
|
|
Top
|
|
|
|
#62398 - 2002-01-25 04:46 PM
Re: turn around @userid
|
Conn TS
Lurker
Registered: 2002-01-25
Posts: 4
Loc: IJsselmuiden
|
DrillSergeant,The first peace of script works perfect only i forgot to tell that the $gwnaam my not contain moren than 8 characters. Can i add something to let it work perfect?
|
|
Top
|
|
|
|
#62399 - 2002-01-25 04:53 PM
Re: turn around @userid
|
DrillSergeant
MM club member
   
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Hi Rick,Of course!  try this: $last=@FULLNAMEwhile instr($last,' ') $last=substr($last,instr($last,' ')+1,len($last)) loop if len($last)>7 $last=substr($last,1,7) endif $gwnaam=lcase(substr(@FULLNAME,1,1)+$last)
_________________________
The Code is out there
|
|
Top
|
|
|
|
#62400 - 2002-01-25 04:56 PM
Re: turn around @userid
|
Conn TS
Lurker
Registered: 2002-01-25
Posts: 4
Loc: IJsselmuiden
|
YESSSSS, Thank ya
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 476 anonymous users online.
|
|
|