Page 1 of 1 1
Topic Options
#166168 - 2006-08-21 07:53 PM Color in a variable
Georges_K Offline
Getting the hang of it

Registered: 2005-02-17
Posts: 83
Loc: Chino, CA
Hey guys, quick question. is there a way to assign a color to a variable, such as:
dim $red $red="Color r+/n" that doesn't seem to work for me.
is there any other correct way to do it?
Thanks!!
_________________________
Network Specialist
Chino Unified School District

Top
#166169 - 2006-08-21 08:35 PM Re: Color in a variable
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Execute() it, or create a UDF called Red().
Top
#166170 - 2006-08-21 08:35 PM Re: Color in a variable
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
I guess that depends on what you're trying to do exactly. But here are two approaches to something like that...

Code:

$red = 'Color r+/n'
$ = execute($red)
? 'this should be red'



or

Code:

$red = 'r+/n'
color $red
? 'this should be red'


Top
#166171 - 2006-08-21 08:38 PM Re: Color in a variable
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You can use variables as parameters to the color command, example:

Code:

Break On

$colors = "N","B","G","C","R","M","Y","W","N+","B+","G+","C+","R+","M+","Y+","W+"

for $i = 0 to ubound($colors)

color $colors[$i]/N

?"The Quick Brown Fox jumped over the Lazy Moon"

Next

Exit 0



-Shawn

Top
#166172 - 2006-08-21 08:40 PM Re: Color in a variable
Georges_K Offline
Getting the hang of it

Registered: 2005-02-17
Posts: 83
Loc: Chino, CA
well , I'm creating an AD user/share management script for our helpdesk , and I'm creating a menu, to which there are action letters which I want to highlight in a different color. so I'm trying to put the color in something small so that I don't have to type the whole string everytime I want one character in a different color.

I think a quick UDF for the color might be the way to go. Thanks for the ideas, that pointed me in the right direction.

Top
#166173 - 2006-08-21 08:52 PM Re: Color in a variable
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You could also use kixforms for this. Looks a lot nicer then the command line box.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#166174 - 2006-08-21 08:56 PM Re: Color in a variable
Georges_K Offline
Getting the hang of it

Registered: 2005-02-17
Posts: 83
Loc: Chino, CA
That's true, I've thought about that, but for now I'm looking to get the script working, then maybe I'll look into making a kix forms wrapper for it. mostly because I have zero experience with kixforms at this point, and I need to get this deployed soon.
Top
Page 1 of 1 1


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

Who's Online
0 registered and 931 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.062 seconds in which 0.028 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