Page 1 of 1 1
Topic Options
#62393 - 2002-01-25 03:50 PM turn around @userid
Conn TS Offline
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
#62394 - 2002-01-25 03:56 PM Re: turn around @userid
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Conn,

What version of KiXtart are you using ? KiXtart 4.02 has much more advanced string handling functions than 3.63 - makes a big difference.

-Shawn

Top
#62395 - 2002-01-25 04:03 PM Re: turn around @userid
New Mexico Mark Offline
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 Offline
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 Offline
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 Offline
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 Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi Rick,

Of course!

try this:


$last=@FULLNAME

while 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 Offline
Lurker

Registered: 2002-01-25
Posts: 4
Loc: IJsselmuiden
YESSSSS, Thank ya
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 811 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org