Search the web
Sign In
New User? Sign Up
cbaspadandhotpawbasic · cbasPad and HotPaw Basic - Discussions about cbasPad and HotPaw Basic
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Mid$   Message List  
Reply | Forward Message #2090 of 2112 |
Re: Mid$

Hi

The function mid$(a$,n)=c$ doesn't exist.

Once upon a time I wrote a 'user-defined' function.
Maybe it can be useful for you:

midassign$(a$,n,b$) is almost equivalent to: mid$()=...

a$=midassign$("abcdefg",3,"xxx")
yields a$="abxxxfg"
a$=midassign$("abcdefg",5,"xxx")
yields a$="abcdxxx"
a$=midassign$("abcdefg",7,"xxx")
yields a$="abcdefxxx"

sub midassign$(zz$,z,zy$)
zz=len(zz$)
zy=len(zy$)
zx$=zz$
if zz>=z and zy>0 and z>0
zz$=left$(zz$,z-1)+zy$
if (z+zy-1)<zz
zz$=zz$+mid$(zx$,z+zy)
endif
midassign$=zz$
endif
end sub.

HTH
G.

This and other 'user-defind functions' can be found in my yBasic
reference listdb in the Files section

BTW: There is no need for line numbers. (unless you're using the
scratchpad ).




Sat Jun 7, 2008 10:12 pm

mauseohr1944
Offline Offline

Forward
Message #2090 of 2112 |
Expand Messages Author Sort by Date

Does HotPaw Basic support using a mid$ function on the left side of an equal sign? I get a syntax error, but I know it works in other dialects of Basic. I...
computerguy47
Offline Send Email
Jun 7, 2008
12:59 am

Hi The function mid$(a$,n)=c$ doesn't exist. Once upon a time I wrote a 'user-defined' function. Maybe it can be useful for you: midassign$(a$,n,b$) is almost...
mauseohr1944
Offline
Jun 7, 2008
10:12 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help