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)
|