mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#114301 13/03/05 05:42 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
i am trying to create a huge list of all the colors (in hex; #000000 etc)
starting from #FFFFFF at the top, and working all he way down to #000000 at the bottom. im not really sure at all how to begin to do this though
afaik, the letter and number combos are A - F, 0 - 9 so as you can see this would make a really big list.

#114302 13/03/05 06:18 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
The list will be 16777216 items long. Far too long to read or be of any practical use for anything. The window buffer isn't large enough to store even a fraction of the list. mIRC scripting simply can't produce it in any reasonable amount of time. What's the point of it anyway?

If it's just as a matter of interest in how to do it:
Code:
listhex {
  if ($window(@hexcolours)) clear @hexcolours
  window -h @hexcolours
  var %i = 16777215
  while %i {
    echo @hexcolours $+($chr(35),$base(%i,10,16,6))
    dec %i
  }
  echo @hexcolours #000000
  window -wa @hexcolours
}


Notice the use of /window's -h switch to hide the window while it's being worked on. This makes the operation 4-10x faster.

#114303 13/03/05 06:22 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
well this is actually for a VB list box, but writing the list to a text file will suffice it does not have to be an @window

#114304 13/03/05 06:27 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Writing to a file would likely take even longer. If it's for a VB listbox why not write the code in VB?

#114305 13/03/05 06:41 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
i dont know how to do that either!! blush

#114306 13/03/05 06:43 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Code:
dim i as long
i = 16777215
while i > 0
list1.additem "#" & hex(i)
i = i - 1
wend
list1.additem "#000000"

#114307 13/03/05 06:46 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
well i dont want the user to wait for hours for tha code, but i can use it to get the list

#114308 13/03/05 08:51 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
i cant get the list. the program doesnt finish, it just goes into not responding, mirc too.

#114309 13/03/05 09:21 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Visual basic isn't the greatest of languages to do anything too CPU intensive, you should use a language that supports multi-threading like C++.

#114310 13/03/05 10:37 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
no thanks. vb owns all... its the most popular too.

#114311 13/03/05 10:42 PM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
I made a small vbscript snippet and it got that list in under 2 mins. The .txt file is 142 mb though, totally useless. What is this for anyway? As if anyone is crazy enough to scroll in a list that's so long.

Just let them make the hex color and use a verifier on it, or what do you need this for?

#114312 13/03/05 10:46 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Quote:
its the most popular too.


Yeah and pigs fly.

#114313 13/03/05 10:57 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
And I quote...

Quote:
Visual Basic (VB) is a RAD (Rapid Application Development) tool, that allows programmers to create Windows applications in very little time. It is the most popular programming language in the world, and has more programmers and lines of code than any of its nearest competitors.

#114314 13/03/05 10:59 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
damn... that sucks.. 142mb...what am i supposed to do now smirk
im trying to give the user a selction of all the colors to pick from...

#114315 13/03/05 11:00 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Use the common dialog (Colour).

Edit: why are you asking vb questions on a mIRC forum anyway?

Last edited by tidy_trax; 13/03/05 11:01 PM.
#114316 13/03/05 11:19 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
i dont know what that is.. blush

i originally wanted a mirc sciprt... remember?

#114317 13/03/05 11:28 PM
D
DaveC
DaveC
D
Quote:
Visual Basic (VB) is a RAD (Rapid Application Development) tool, that allows programmers to create Windows applications in very little time. It is the most popular programming language in the world, and has more programmers and lines of code than any of its nearest competitors.


That "most popular programming language" becomes true when and only when it is applied with "and has more programmers and lines of code than its nearest competitor"

And even then im not sure if thats strictly true even! Sounds more like a MS advert for there software than anything else.

I dont know the totals but I beleieve Cobol likely still outnumbers vb for lines of code, just not programmers.

This has digressed anyway...

I would suggest you google a search for "html color codes list" and just draw down one of them for your listy of hexvalues and colors

#114318 13/03/05 11:29 PM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
The CommonDialog Control

It's very easy to use, I've used it with COM before, but not the showcolor method, rather the showopen method. It even comes with a vb example, what more can you want grin

#114319 14/03/05 12:02 AM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
mm.. ko...w/e

i did search google they dont have the complete list any where

#114320 14/03/05 05:56 AM
Joined: Dec 2002
Posts: 1,214
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,214
Search Google using the Keywords HTML color reference. Here is one of the results:

Color Index

I hope this is what ya meant..if not my bad

Page 1 of 2 1 2

Link Copied to Clipboard