navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

A problem with trim

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> A problem with trim
Page: [1]
 
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
A problem with trim - 9/17/2007 14:56:30   
How do I fix it.

I have this bit of code that works well
<%= Left((rstGetCompanyDetail.Fields.Item("FIN_AFFAIR").Value),10) %>

Now I want to do the same thing but from the right. I try the obvious.
<%= Right((rstGetCompanyDetail.Fields.Item("FIN_AFFAIR").Value),10) %>

I don't even get an error it just ignores and reads data to the page.

So I try this:
<%
Dim strLeftText
strExample = rstGetCompanyDetail.Fields.Item("FIN_AFFAIR")
strLeftText = Right(strExample, 10)
Response.Write strLeftText
%>
Acts just like it did when I did it the sloppy way.

Thanks!
Rich



_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”

ou812

 

Posts: 1603
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: A problem with trim - 9/17/2007 15:19:31   
I'm not sure I understand what it is or isn't doing for you, but maybe try trim, or get the len, to make sure you know what you're working with.

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to mar0364)
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: A problem with trim - 9/17/2007 15:26:52   
It not removing characters from the left side of the string. For example

biguglydog

I want to only print dog.

Is that more understandable?

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to ou812)
ou812

 

Posts: 1603
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: A problem with trim - 9/17/2007 16:02:19   
Yeah, that's what I thought you meant, but it all seemed okay is why I wondered. When I try what you're doing, both ways, it works fine with me. No idea why it isn't working for you. Any funny characters in the text you're working with? There are more than 10 characters in your text, right? Hmmm :)

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to mar0364)
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: A problem with trim - 9/17/2007 16:05:51   
The text does contain a url that is about 50 charcters long. Examples

\\RLTLHNAS\folder\subfolder\file.pdf

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to ou812)
ou812

 

Posts: 1603
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: A problem with trim - 9/17/2007 16:09:37   
Weird. I tried your example text and it works for me as well...

Some of my test results:
Left
\\RLTLHNAS
\\RLTLHNAS
Right
r\file.pdf
er\file.pdf
der\file.pdf
lder\file.pdf

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to mar0364)
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: A problem with trim - 9/17/2007 16:12:32   
Thanks! I 'll keep plugging away at it.

Regards!
Rich

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to ou812)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A problem with trim - 9/17/2007 16:21:06   
What does trim do for you?

<%= Right(trim(rstGetCompanyDetail.Fields.Item("FIN_AFFAIR").Value),10) %>

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mar0364)
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: A problem with trim - 9/17/2007 16:45:27   
Oh great one how do you do it???

What did I miss man??

Thanks!:)

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A problem with trim - 9/17/2007 16:56:37   
Depending on the field type or content - Im assuming there may be some padding characters in there?


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mar0364)
ou812

 

Posts: 1603
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: A problem with trim - 9/17/2007 18:32:25   
I could've sworn I said trim in my first reply... hey I did! Okay, so you ignored me and went with the sure thing - Spooky. :)

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A problem with trim - 9/17/2007 19:19:54   
Shhh... dont deny me my moment of glory :)

(I read your answer properly too ;--)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to ou812)
mar0364

 

Posts: 3221
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: A problem with trim - 9/18/2007 8:27:19   
Probelm is your so smart I didn't understand you. Spooky had to dumb it down for me.

Really thanks!

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to ou812)
ou812

 

Posts: 1603
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: A problem with trim - 9/18/2007 12:05:00   
It's just so darn hard to beat Spooky and the gang(Roger, Duane, you, etc.) to an answer, when I actually have one. :)

Most importantly, glad you got it working.

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to mar0364)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A problem with trim - 9/18/2007 15:20:21   
quote:

Probelm is your so smart I didn't understand you. Spooky had to dumb it down for me.


I think that is a compliment for at least one of us :)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to ou812)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> A problem with trim
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts