Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > string functions


Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2001, 04:57 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Question string functions


I am having trouble with string functions, is there a limit to the size of string you can use in functions? In my program if you highlight part of a webbrowsers text, then you can align it left or right etc, this works with small sections but not large ones.
My code is making all the right changes but when Len(strselect) is over about 80 the replace function is not working
<pre>strTotal = Replace(strTotal, strSelect, strNew)</pre>

I have tried using Mid and Instr but these do not detect strSelect either.
Can I do these functions with large strings or am I going to have to break the strings up into an array
Someone please help before I go mad


Reply With Quote
  #2  
Old 03-08-2001, 10:28 AM
karimahta karimahta is offline
Senior Contributor

* Guru *
 
Join Date: Mar 2000
Location: Christchurch, New Zealand
Posts: 470
Default Re: string functions

I have tried this out and a string of 130+ chars was OK.

The only thing I can think of is that you may need to specify the Compare:=vbTextCompare argument in the replace function if perhaps the strings don't match by case for some reason.


HTH

Reply With Quote
  #3  
Old 03-09-2001, 05:48 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: string functions

Thanks!
I tried this out but still can't get more than eighty chars, which doesn't cover much when you take into account all the html tags.
is there a vbhtmlTextCompare, as I am using
Set web1 = WebBrowser1.Document
strTotal = web1.body.innerHTML
strSelect = web1.selection.createRange.htmlText
strNew=strSelect
to extract the string


Reply With Quote
  #4  
Old 03-09-2001, 08:29 AM
klabranche klabranche is offline
Junior Contributor
 
Join Date: May 2000
Location: Arizona
Posts: 288
Default Re: string functions

I would suggest testing to see if web1.body.innerHTML is giving everything and the same for web1.selection.createRange.htmlText.

VB & VBScript do not have limits to strings.

http://www.extreme-vb.net/images/icons/smile.gif
Reply With Quote
  #5  
Old 03-09-2001, 09:12 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: string functions

I have checked this via pop up text boxes and the code matches exactly, also I know that anything less than 80 chars works fine so I can only guess that it has something to do with the length

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->