Page 1 of 1 1
Topic Options
#168594 - 2006-09-29 09:55 AM Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
I'm new to kix can anyone help me with this little code. below is an example.

$CountVal = 30
For $Counter = 1 to $CountVal
? $Counter
EndIf
Next

but I want this code to count in letter fomat

counting from A, b, c, d, e, f, g, etc etc all the way to Z.

TIA

Top
#168595 - 2006-09-29 10:03 AM Re: Count Letters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I can think of a lot of ways of doing this, depending on what you need it for.

Here is one way:
Code:
For $i = 1 to 26
""+$i+": "+Chr(Asc("A")-1+$i)+@CRLF
Next



If this doesn't help, try explaining what you intend to use it for and we will suggest something more appropriate.

Top
#168596 - 2006-09-29 10:44 AM Re: Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
thanks richard that helped. I also just done one myself by playing around.

For $Counter = 65 to 90
? Chr($Counter)
Next


Edited by 5861king (2006-09-29 10:59 AM)

Top
#168597 - 2006-09-29 11:25 AM Re: Count Letters
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm... what ya upto?
Top
#168598 - 2006-09-29 12:23 PM Re: Count Letters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
That looks like drive letters...
Top
#168599 - 2006-09-29 01:35 PM Re: Count Letters
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Then A, B, C should be ignored and on Win9x on a network also ignore Z.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#168600 - 2006-09-29 06:51 PM Re: Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
Quote:

hmm... what ya upto?




I'm makeing a bootable windows xp cd, which has been customised to run certain program and registry changes dureing the install process.

Top
#168601 - 2006-09-29 07:01 PM Re: Count Letters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Why the counting from A to Z?
Top
#168602 - 2006-09-29 08:52 PM Re: Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
Quote:

Why the counting from A to Z?




if some users an external cd-rom or has 1 or more CD Roms, the default cd-rom path is not allway D:, this program will serach all the drive letters looking for a paticular file, if it finds it then the cd-rom drive letter will be recorded as a varible, then my other programs will user the correct cd-rom path

Top
#168603 - 2006-09-29 09:42 PM Re: Count Letters
PaulyT Offline
Fresh Scripter
*****

Registered: 2005-08-24
Posts: 8
Loc: Madtown Wisco
If the script is launched from the CD wouldn't this work?

Left(@ScriptDir, 1)

Top
#168604 - 2006-09-29 09:47 PM Re: Count Letters
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
KiX may not be in the root of the CD, but your idea in general given the proper path sounds valid.
Top
#168605 - 2006-09-29 10:27 PM Re: Count Letters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Much better. Maybe by showing some more of the KiX script, other solutions can be given.
Top
#168606 - 2006-09-29 10:38 PM Re: Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
I'll remeber that for the future. got the script running now and it works a treat. so a big thanks to Witto + Richard H. I can post this script if anyone is intrested in slipstreaming and maeking their own version of a bootable DVD disk.
Top
#168607 - 2006-09-29 10:47 PM Re: Count Letters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Thanks, I only asked questios. Richard H. and PaulyT gave the answers.
[Edit]
Oh yes, it was on the AdminScriptEditor forum
Help with converting .bat file to kix
[edit]


Edited by Witto (2006-09-30 08:37 AM)

Top
#168608 - 2006-09-30 11:42 PM Re: Count Letters
5861king Offline
Fresh Scripter

Registered: 2006-09-28
Posts: 48
Loc: UK
Yep, I tried the WMI version but during the install wmi is not installed, that’s why I wanted to use this method.

Edited by 5861king (2006-09-30 11:43 PM)

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 1013 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.067 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