Page 2 of 2 <12
Topic Options
#72577 - 2003-01-13 08:35 PM Re: Trying to shorten a script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Nope, I switched over to voice-command software. The software has been instructed not to do anything whenever I start a sentence/command with '@#$%' or similar words. [Wink]

[ 13. January 2003, 20:36: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#72578 - 2003-01-13 08:37 PM Re: Trying to shorten a script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well then... what good is it???
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#72579 - 2003-01-15 11:32 AM Re: Trying to shorten a script
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
Once again a big thanks to all for their help.

Jpols I took the UDF you made and adapted it slightly and it works fine. My script may not be any shorter but it looks cleaner.

However, I still don't see the problem with "GOTO" statements. To me they seem clear as to where they point to and what you want them to do.

Top
#72580 - 2003-01-15 11:36 AM Re: Trying to shorten a script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
zdarma, good that you saw it working.
anyway, you asked at the beginning how to shorten the code, didn't you?

and there has been shown multiple ways which are shorter than with udfs...
I must wonder again why you picked it...

anyway, your choice.
_________________________
!

download KiXnet

Top
#72581 - 2003-01-15 11:52 AM Re: Trying to shorten a script
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
Lonkero I didn't choose the UDF to use in my script. I made a copy of my original script to see how the UDF would work after I made a few modifications to it and to see if I could understand the workings of a UDF (it is still a little gray, but I'm getting their).

I actually took Sealleopard's code from 13. January 2003 18:26 and put it into my script.

I just have one more question, why is there a "," at the beginning of the $choice variable by Jpols?

Top
#72582 - 2003-01-16 12:01 AM Re: Trying to shorten a script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
The $Choice Variable is actually an Array of Strings; the first "","app1.exe .... was just to be in line with app numbers (first element is 0)

Yeah .... I must admit that this is not a good way to code your specific example in ANY way !

It was just to show how UDFs can be your friend in shortening, make it re-usable, make more reliable , ... your code [Roll Eyes]

Sorry for the last minute version of dumb UDF example [Frown]
_________________________



Top
#72583 - 2003-01-16 12:26 AM Re: Trying to shorten a script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the choice-var is actually an array in jochens code.
array start from element zero so he just placed "" as the zero element. thus referencing can be directly started with element 1.
_________________________
!

download KiXnet

Top
#72584 - 2003-01-16 12:27 AM Re: Trying to shorten a script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how did I miss jochen's reply, I don't know...

well, same stuff twice... at least it's clear [Wink]
_________________________
!

download KiXnet

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 941 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

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