aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1572

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1572  Substitute for MID$ Statement

20/08/2007 @ 23:45
by Roy Sommers

Anonymous



Hi,
I need to replace a character in a string with a character from another string. I used to do this in Power Basic with the MID$ Statement. Is there a way in iziBasic?
Thanks,
Roy
Write to Roy Sommers   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
21/08/2007 @ 09:20
by aldweb

Anonymous

visitor
Hello Roy,

You have the CHAR$(A$,N) function to get one character from one string which is similar to MID$(A$,N,1) that you may also use.
Then, for the receiving string, use the LEFT$() and RIGHT$() functions to get all positions back except for the one to insert.

Here is a quick example:

A$="1st string"
B$="2nd String"
C$=LEFT$(B$,4)+CHAR$(A$,5)+RIGHT$(B$,5)
D$=LEFT$(B$,4)+MID$(A$,5,1)+RIGHT$(B$,5)
E$=MID$(B$,1,4)+MID$(A$,5,1)+MID$(B$,6,5)
PRINT C$ ' should print: 2nd string
PRINT D$ ' same result
PRINT E$ ' still the same


Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
21/08/2007 @ 14:21
by roy sommers

Anonymous

visitor
Hello aldweb,

Actually, one of my strings is only one character long. This should work fine, thanks a lot.
Roy
Write to roy sommers   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^