ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old June 16th, 2003, 04:52 AM
[RID]FRENZY [RID]FRENZY is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 [RID]FRENZY User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Replace problems

Well I am using the standard replace function in an aspx file, heres the code:

dim strpx as string
dim strbegin,strend,endvalue,intCounter,oldvalue as integer
strbegin = 5
oldvalue = 0
'for intCounter = 1 to 3
do
oldvalue = oldvalue + 1
response.write (strbegin & " <b>" & oldvalue & "</b><br>")

strbegin = inStr(strbegin,newimageurl,"top:") + 4


strend = inStr(strbegin,newimageurl,";") - strbegin

response.write (strend & "<br>")
response.write (instr(strbegin,mid(newimageURL,strbegin,strend),"px") & "<br>")
if strbegin <> 4 then
if len(mid(newimageURL,strbegin,strend)) > 3 then
endvalue = (mid(newimageurl,strbegin,strend - 2) + 150)
strpx = "px;"
else
endvalue = (mid(newimageurl,strbegin,strend) + 150)
strpx = ";"
end if

response.write (endvalue & "<br>" & (strbegin - 4) & "<br><br>")

newimageurl = replace(newimageurl,"top:" & mid(newimageurl,strbegin,strend) & ";","top:" & endvalue & strpx,(strbegin - 4),1)
end if

loop until strbegin < 5

the bit what is creating the problem is:

newimageurl = replace(newimageurl,"top:" & mid(newimageurl,strbegin,strend) & ";","top:" & endvalue & strpx,(strbegin - 4),1)

More specifically the start that I have set as a variable (strbegin - 4)

if I leave this as 1 it goes through and works fine on most pages, but on a few pages the numbers are duplicated and it modifies the same one twice and other ones none at all. when I try to set the start to the variable so it starts in the right place it ends up replacing most of the areas I am searching and replacing.

I have checked the variable and I am at a complete loss as to what is happening as it is definately the right number?

The only thing I can think of is if it is because of the .aspx (.net) extension not liking variables for the start area of the replace function.

Any help greatly appreciated.

Reply With Quote
  #2  
Old June 16th, 2003, 05:25 AM
[RID]FRENZY [RID]FRENZY is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 [RID]FRENZY User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
never mind I figured out what was wrong, the start argument deletes everything in the string to the left of the character count

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Replace problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway