#204458 - 2012-03-14 04:25 PM
Count first 8 Character of username
|
Playford
Fresh Scripter
Registered: 2012-03-14
Posts: 7
Loc: Scotland
|
Hi all,
This is my first post here.
I use printers that only have space for 8 character for the hold print function.
I need to have a script to get the current username and only use the first 8.
I've only really used KIX to add a couple of print Q's and connect a couple of network drives so my knowledge is quite limited.
From what I've found I need to read the username into an array and use the split command but I'm not sure how to count the 8 characters. Help would be greatly appreciated.
Thanks Mark
|
|
Top
|
|
|
|
#204468 - 2012-03-15 01:24 PM
Re: Count first 8 Character of username
[Re: Mart]
|
Playford
Fresh Scripter
Registered: 2012-03-14
Posts: 7
Loc: Scotland
|
Thanks so much for the reply. It works perfectly.
All I need to do is now stip out the "." in between the first and last name.
Thanks Mark
|
|
Top
|
|
|
|
#204469 - 2012-03-15 02:08 PM
Re: Count first 8 Character of username
[Re: Playford]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
$username = Replace(@userid,".","")
$username = Replace($username,"-","")
$username = Replace($username,"_","")
$username = Replace($username," ","")
$username = SubStr($username,1,8)
? $username
|
|
Top
|
|
|
|
#204511 - 2012-03-19 11:27 AM
Re: Count first 8 Character of username
[Re: Glenn Barnas]
|
Playford
Fresh Scripter
Registered: 2012-03-14
Posts: 7
Loc: Scotland
|
I would like to say a massive thank you all for your help.
I now have the scipt working perfectly.
Thanks Mark
|
|
Top
|
|
|
|
#204512 - 2012-03-19 11:32 AM
Re: Count first 8 Character of username
[Re: Playford]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
Nice Loopwork there Glenn
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 793 anonymous users online.
|
|
|