Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Multi StrInsert


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-26-2008, 07:31 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default Multi StrInsert

Hi all,

Does anyone know is it possible to have a multiple StrInsert in a single code?

Example:

a=strinsert(textbox1.Text,8,";") + strinsert(textbox1.text,32,";")

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-26-2008, 08:23 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 707
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hello tcgoh
Insread of
a=strinsert(textbox1.Text,8,";") + strinsert(textbox1.text,32,";")
this work in VB but not in Basic4PPC

you must use the concatenation character.
a=strinsert(textbox1.Text,8,";")&strinsert(textbox 1.text,32,";")

Best regards
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 01-26-2008, 09:24 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Hi Klaus

Thanks for the reply. But your code does work also.

Error: Variable: Textbox was not assigned any value.

Thanks
Reply With Quote
  #4 (permalink)  
Old 01-26-2008, 02:33 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 650
Default

I think you have used copy and paste ... but you haven't removed the space in the second line of the code klaus provided.
There has to be no space between "textbox" and "1" ...


specci48
Reply With Quote
  #5 (permalink)  
Old 01-26-2008, 02:35 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

There is an extra space between textbox and 1.
Try:
Code:
a=strinsert(textbox1.Text,8,";") & strinsert(textbox1.text,32,";")
I'm not sure that this is what you want to achieve.
If you want to add these two characters, you need:
Code:
a = StrInsert(StrInsert(TextBox1.Text,8,";"),33,";")
Reply With Quote
  #6 (permalink)  
Old 01-26-2008, 02:45 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 707
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Of cours the extra space must not be there, was a wrong typing, I was concentrated in replacing the '+' sign by '&' .
Sorry for the mistake.
Klaus
Reply With Quote
  #7 (permalink)  
Old 01-26-2008, 02:47 PM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Hi Erel,

Oh Ya, there is space there. Thanks.

But Erel is right on the spot on what I wanted. ie, add 2 char on the same line.

Thanks again to all, the second code works fine.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel Processing / Multi-Threading questions TWELVE Questions & Help Needed 7 04-29-2008 12:40 PM
toolbar and multi form giannimaione Share Your Creations 2 01-18-2008 05:11 PM
Multi-tab forms Rioven Questions & Help Needed 6 06-11-2007 04:49 AM


All times are GMT. The time now is 07:02 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0