incrementing letters like we do numbers...
Bruce Easton
bruce at stn.com
Wed Apr 30 17:51:49 PDT 2014
On 4/30/14 8:40 PM, James Flanagan wrote:
> FreeBSD 9.2
> Filepro 5.7.04
>
> I am looking for the most elegant way (i.e the fewest lines of code) to increment through the alphabet in a way similar to how i would do it with numbers.
>
> every year, i need to code to create the 26 folders for each letter of the alphabet. below is the basics of the code that i would like to use (but it does not work because when you add “1” to a a variable that is a letter, the variable becomes a number instead of incrementing the letter):
>
> fld_ltr::':
> ::folder_letter="A":
> fld_lop::':
> ::folder=root_folder{slash{company_name{slash{"photos"{slash{job_year{slash{folder_letter:
> ::unix="mkdir"<folder:
> ::system noredraw unix
> :folder_letter eq “Z":return:
> ::folder_letter=folder_letter+"1":
> ::goto fld_lop:
>
> I am hopeful that i can avoid writing 26 differently lines of code to account for each letter folder. thank you very much,
>
> James Flanagan
> Flantec.com
>
>
James, I believe on the line where you increment, you just need instead:
::folder_letter=chr(asc(folder_letter)+"1"):
Bruce
More information about the Filepro-list
mailing list