#98874 - 2003-02-27 08:43 PM
Loop Header issue with KiXstrip
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
MCA,
Noticing a peculiar behavior with KiXstrip..
Consider the following code: code:
IF $profile_remove = 'YES' $index = 0 :loop4 $keyname = ENUMKEY($profilelocation, $index) IF @error = 0 IF $keyname <> @userid OR $keyname <> 'Sales' $rc = DELTREE($profilelocation+'\'+$keyname) $index = $index + 1 GOTO Loop4 ENDIF ENDIF ENDIF
Can we do something like? code:
IF $profile_remove = 'YES' $index = 0 :loop4 $keyname = ENUMKEY($profilelocation, $index) IF @error = 0 IF $keyname <> @userid OR $keyname <> 'Sales' $rc = DELTREE($profilelocation+'\'+$keyname) $index = $index + 1 GOTO Loop4 ENDIF ENDIF ENDIF
What are your thoughts with this?
Kent
|
|
Top
|
|
|
|
#98877 - 2003-02-27 09:07 PM
Re: Loop Header issue with KiXstrip
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Argghh!
Good point..
Lemme dig..
Kent
|
|
Top
|
|
|
|
#98878 - 2003-02-27 10:07 PM
Re: Loop Header issue with KiXstrip
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
OK.. Trying to get some code together that will do this..
Also found another post from Rad (MapPrinter) that does this too.
OK.. Here is some code. Trying to think in terms of working with 3.63 and up..
code:
IF $profile_remove = 'YES' $index = 0 WHILE ENUMKEY($profilelocation, $index) AND @error = 0 IF $keyname <> @userid OR $keyname <> 'Sales' $rc = DELTREE($profilelocation+'\'+$keyname) $index = $index + 1 ELSE $index = $index + 1 ENDIF LOOP ENDIF
Thanks,
Kent
|
|
Top
|
|
|
|
#98880 - 2003-02-28 01:27 AM
Re: Loop Header issue with KiXstrip
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Kent,
We agree with Les, that it isn't a nice way of programming but sometimes such structure is necessary to make things possible. Things possible which can be done in another way.
At this moment it doesn't high priority on our list. Reason: normally it is a very bad habit to use labels. It aren't only GOTO labels, but also GOSUB labels we have to deal with.
In your second example it can be very hard to find used labels back. For that reason we put them always at the beginning of a line. In most cases it was already at the beginning of that line. greetings.
|
|
Top
|
|
|
|
#98882 - 2003-02-28 07:48 AM
Re: Loop Header issue with KiXstrip
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Jooel,
You are right, Sales is not used. With your ideas, I removed the GOTO.
Starting to look better.
Kent
|
|
Top
|
|
|
|
#98884 - 2003-02-28 07:28 PM
Re: Loop Header issue with KiXstrip
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Was trying to code together a method to remove the "OEM User", "Microsoft Exchange Settings", etc. from the user's profile and then start fresh.
The looping structure has been updated in the Outlook/Exchange FAQ.
Thanks,
Kent
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 884 anonymous users online.
|
|
|