From: "Barry Erick"
Subject: Re: Sub's Or defining Procedures
Peter,
You need to do this:
a$=LEFT(b$,1)
changeletter a$
SUB changeletter(b$)
if b$ = "a" then c$ = c$+"z"
if b$ = "b" then c$ = c$+"y"
'etc. etc.
' now, to return c$ in b$
b$= c$ 'because c$ is local... else make c$ SHARED or PUBLIC so it will
show above
END SUB
Or, as a function
a$ = Left$(b$,1)
PRINT ChangedLetter$(a$)
FUNCTION ChangedLetter$(b$)
if b$ = "a" then c$ = c$+"z"
if b$ = "b" then c$ = c$+"y"
'etc. etc.
ChangedLetter$=c$
END FUNCTION
Peter.waller wrote in message ...
|Hallo There, (If This Question has been asked before DONT BLAME ME BECAUSE
|I am 11 Years Old!!!)
|Erm, I Have been Trying To Define a procedure that will detect a letter and
|change it To the opposite letter.
|I would like to call it like this:
|
|
|a$=LEFT(b$,1)
|run proc changeletter a$
|
|PROC changeletter
|if b$ = "a" then c$ = c$+"z"
|if b$ = "b" then c$ = c$+"y"
|etc. etc.
|END proc
|
|What is the Problem,
|
|Please explain
|
|Thanx
|Pete
|
|--
|Please remove NS from reply address if you
|wish to reply
|in other words reply to peter.waller@btinternet.com
*** QwkNews (tm) v2.1
* [TN11.1] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|