[Date Index] [Thread Index] [Author Index]
Re: Got a tip ?
ToCharacterCode[ ] returns the ASCII values of the characters that make up the string that it gets as argument. If you only use lowercase characters, you then subtract 96 to end up with values starting at 1. Another function that may be useful to you is Characters[ ], which splits a string in a list of characters. Module and Block are totally irrelevant in this context. Cheers -- Sjoerd On Mar 23, 11:04 am, Fabrizio <Tekciti... at hotmail.Com> wrote: > Hello, > > I want to write a function that translates its argument (which is a lette= r of the alphabet) into a numerical value. > > f[a] = 1 > f[b] = 2 > > . > > If this small module is finished, i want to expand the function by giving= as an argument; a string of letters (or a text), but i have no clue which = functions i have to use to define the smaller part (only letters) first. Wh= at functions can i use for all of this and how do i handle the variables ? = Does the difference between Module and Block come into play ? Or . . .any h= elp is much appreciated.