#38664 - 2003-04-02 11:08 AM
Modified AT()
|
jtrainer
Fresh Scripter
Registered: 2002-03-06
Posts: 36
|
Collective,
I'd like to use the AT function, however....
I have grown to appreciate the Red Hat startup/shutdown OK and Error indicators. I have recreated this with my script, however, I cannot place the [OK] to begin at a specified collum.
When processing the logon/logoff script, my [OK]'s move left and right, depending on the lenght of the informational string provided. I.E.
Now mapping U: to \\server\share [OK] Now mapping U: to \\diffserver\longshare [OK] Now mapping U: to \\srva\anothershare [OK]
How can I get the AT() function to use a ('leave me alone value', 60)?
To simply state it, I want to be able to write at collum X, I don't care what row I'm at.
Thanks jtrainer
_________________________
Bumped my mouse again, time to reboot Windoze....
|
|
Top
|
|
|
|
#38666 - 2003-04-02 11:43 AM
Re: Modified AT()
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
I posted a UDF a few days ago which is used for formatted output, this would do the jobs for you.
The UDF is in this thread
Call it like this:
code:
udfFormatField("Now mapping U: to whatever",59,"L")
That will leave the cursor at column 60. [ 02. April 2003, 11:45: Message edited by: Richard H. ]
|
|
Top
|
|
|
|
#38667 - 2003-04-02 11:52 AM
Re: Modified AT()
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
A really simple solution would be:
code:
$sSpace10=" " $sSpace80=$sSpace10+$sSpace10+$sSpace10+$sSpace10+$sSpace10+$sSpace10+$sSpace10+$sSpace10 ... Left("Mapping U: to whatever"+$sSpace80,59)
|
|
Top
|
|
|
|
#38671 - 2003-04-03 10:20 AM
Re: Modified AT()
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
What operating system are you running this on?
If Win9x, try the @WUSERID macro, @USERID is for NT.
You could also try the environment variable %USERNAME%
Finally, it is good coding practice to place any variables outside the string delimiters, so:
code:
Left("Mapping U: to \MyServer\MyShare\"+@USERID+$sSpace80,59)
|
|
Top
|
|
|
|
#38672 - 2003-04-08 03:02 PM
Re: Modified AT()
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
I've just posted details of a utility here which you can use to get the current cursor position.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(mole)
and 1300 anonymous users online.
|
|
|