>>lcLoginString = "jpaskett,ADMINISTRATOR,*******"
>>
>>this.cUserName = LEFT(lcLoginString, AT(",", lcLoginString) - 1)
>>this.cUserLevel = SUBSTR(lcLoginString, AT(",", lcLoginString) + 1)
>>this.cUserLevel = LEFT(this.cUserLevel, AT(",", this.cUserLevel) - 1)
>>
>
>Try:
>
>nFirstComma = At(',', lcLongString, 1)
>nSecondComma = At(',', lcLongString, 2)
>This.cUserName = Substr(lcLongString, 1, nFirstComma - 1)
>This.cUserLevel = Substr(lcLongString, nFirstComma + 1, nSecondComma - 1)
>This.cUserLevel = Substr(lcLongString, nSecondComma + 1)
Alexandre,
If I'm not mistaken, doing this in my command window returns me the following;
nFirstComma = 9
nSecondComma = 23
FirstName works fine, however;
This.cUserLevel = Substr(lcLongString, nFirstComma + 1, nSecondComma - 1)
will return 'ADMINISTRATOR,****'
This.cUserLevel = Substr(lcLongString, nSecondComma + 1)
will return '****' because we are starting at the second comma and returning the remainder of the string.
But if I used the following it should give me what I want;
This.cUserLevel = LEFT(cUserLevel, AT(',', cUserLevel) - 1)
The code I have originally works fine, but I want to avoid, as much as possible, the amount of times the program has to evaluate and redefine this value.
Thanks,
Jon
Jon Paskett
Microsoft Certified Systems Engineer
We all have to start somewhere...
Sometimes over again!