TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: DON SCHULLIAN
date: 1998-01-30 16:03:00
subject: Re: Sub`s Or defining Pro

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.