From: d83@ath.forthnet.gr (Don Schullian)
Subject: Re: Sub's Or defining Procedures
On Thu, 29 Jan 1998 08:59:44 +0000, jmejuto@pobox.com (Jose Mejuto) wrote:
> Of Course this is not the best way... look at this:
>
> A$=Left$(B$,1)
> ChangeLetter (B$)
>
Sub ChangeLetter(B$)
Target$="zyxwvutsrqponmlkjihgfedcba"
P% = ASCii(B$) - 96
IF P% > 0 AND P% < 27 THEN B$ = MID$(Target$,P%,1)
End Sub
Am I missing something here??? We're talking about PowerBASIC, right? Why not
use the REPLACE function?
F$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
T$= "zyxwvutsrqponmlkjihgfedcba"
REPLACE ANY F$ WITH T$ IN B$
____ _ ____ ____ _____
| _ \ / \ / ___) __ | ___)(_ _)
| |_) / _ \ \____\/ \| _) | |
|____//_/ \_\(____/\__/|_| |_|
Reply to: d83@ath.forthnet.gr
www.basicguru.com/schullian
*** QwkNews (tm) v2.1
* [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|