|
-
Jul 18th, 2008, 05:21 PM
#1
Thread Starter
Lively Member
[RESOLVED] Overlap through array?
Hi.
I have a string array with the contents of the alphabet:
MyString(0) = "a"
MyString(1) = "b"
etc
I have a function that takes a letter and an integer and returns the letter.
For example:
GetAlpha("c",2) would return "e" because 2 placements ahead of c is e.
For the function above if I get a number that exceeds the upper bound I use the mod operator to 'overlap?' again. This works fine from what I have tested.
But the problem is if I use a negative number that exceeds the lower bound, how do I overlap from the end?
Like if I do GetAlpha("a",-2) if would return "y".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|