> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Alan Bourke
> Sent: Wednesday, April 22, 2009 7:43 AM
> To: [email protected]
> Subject: RE: position of item in a list
> 
> You still haven't told us how these strings are initially stored !
> 
> is it :
> 
> bigstring = ["A", "B", "C", "D"]
> 
> or a Collection object containing string items?
> 

It's a long story...   I am writing a program to change user access
permissions to a 3rd party product we use here, because their interface
is a total kludge-o-matic.
 
I have a form method that has a user selected action choice being passed
in (VIEW, ADD, EDIT, etc.). Based on this choice I was using a CASE
statement to determine a starting position in a string to change. The
string I am changing is a concatinated string of all the user choices
i.e. "YNYY" means user permissions are VIEW, can't ADD, EDIT, DELETE,
etc.)

My case statement merely calculated which of the positions in the string
I wanted to change:

lcAcclvl = "YNYY"

DO CASE
CASE lcOption = "VIEW"
  lnPosition = 1
CASE lcOption = "ADD"
  lnPosition = 2
CASE lcOption = "DELETE"
  lnPosition = 3
......

lcNewString = stuff( lcAcclvl, lnPosition, 1, 'T')

Now if I wanted to, I could do it this way:

lcString = ["VIEW","ADD","EDIT","DELETE","APPROVAL","CHNG_STAT"]
Alines(laStrings, lcString,0,",")
lnIndex = Ascan(laStrings, [lcUserChoice])

lcNewString = stuff( lcAcclvl, lnIndex, 1, 'T')


Matt Jarvis
Programmer/DBA
King | Retail Solutions 
 




Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to