TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: JOSE MEJUTO
date: 1998-01-29 08:59:00
subject: Re: Sub`s Or defining Pro

From: jmejuto@pobox.com (Jose Mejuto)
Subject: Re: Sub's Or defining Procedures
 
"Barry Erick"  wrote:
 
 BE> Peter,
 BE> You need to do this:
 BE> a$=3DLEFT(b$,1)
 BE> changeletter a$
 BE> SUB changeletter(b$)
 BE> if b$ =3D "a" then c$ =3D c$+"z"
 [...]
 
 Are you really trying to help Peter or you want to confuse him ? It's
really more easy than your code:
 
 A$=3DLeft$(B$,1)
 ChangeLetter (B$)
 
 Sub ChangeLetter(B$)
     Select Case B$
            Case "a":B$=3D"z"
            Case "b":B$=3D"y"
            ....
    End Select
 End Sub
 
 Of Course this is not the best way... look at this:
 
 A$=3DLeft$(B$,1)
 ChangeLetter (B$)
 
 Sub ChangeLetter(B$)
     Target$=3D"zyxwvutsrqponmlkjihgfedcba"
     B$=3DMid$(Target$,ASCII(B$)-96,1)
 End Sub
 
--
Jose Mejuto 
 - - - - -  http://www.pobox.com/~jmejuto
 - - - - -  FidoNet 2:348/102.0
 
*** QwkNews (tm) v2.1
 * [TN11.1] 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™.