Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alphabetic numbering system
Message
 
To
08/01/1999 12:44:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00174074
Message ID:
00174099
Views:
36
Erik,

I do not think the logic should be too hairy.

Create a function that takes a letter, increments it (after
converting it to a number), and returns two pieces of information,
the letter it has been incremented to, and zero or one. Zero
indicates that you do not need to anything more, 1 means you need
to increment the next letter.

Then call this function for the first digit. Return of Zero, do nothing
with the other digits, return of 1, call the function with the next
digit to the left, etc...., to the end. (Moving from one digit to the next
digit to the left can be a FOR...NEXT loop).

All of this can be in a wrapper function to which you pass your initial
string, eg.. (X = WRAPPER_FUNCTION("AABC"))

I did that once but not in FoxPro, and it was relatively quick
to code.

Hope it all made sense.

Michel.

PS: To return two pieces of information from a function, return them
as a string and split them out.

=================== Original message follows ====================

>>Do you have a copy of Codebook? I'm pretty sure there's a Base36 function in there that could be adapted to what you want.
>
>Yeah, I do. I have looked in the book, because I thought I remembered something like that, but I didn't find it. I also did a search of my codebook projects (using my nifty SearchString tool :-)) and came up with nothing. Do you remember what the function is called?
>
>
>>Otherwise just take the rightmost char, use asc() to convert it to a number, increment it, if goes over "Z" set it to A and increment the next digit to the left.
>
>I started laying out logic to do exactly this and it got pretty hairy. That's why I was looking for some other creatice solutions...
>
>Thanks for your help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform