Normal Topic Replace Problem! (Read 776 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Replace Problem!
Jun 24th, 2010 at 9:05pm
Print Post Print Post  
Hello!
This Code  does not work for me. Pease help me.

     If @lt(vergebnis,1) = @Ch(60)
{
vErgebnis = @replfir(vErgebnis,@Ch(60),"")
vwertungErgebnis = @Ch(60)
}

or

     If @lt(vergebnis,1) = "<" then
{
vErgebnis = @replfir(vErgebnis,"<","")
vwertungErgebnis = "<"
}
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Replace Problem!
Reply #1 - Jun 24th, 2010 at 11:51pm
Print Post Print Post  
Are you working with the correct variable? Because it works as I would expect it to. Both of your approaches are producing the same results.

The results of the following code (which is mostly the same as your example, except that I added the variable declarations, and some WriteLn commands to view the results) produces the output at the end of this message.

Code
Select All
var vergebnis as string
var vwertungErgebnis as string

vergebnis = "<TestThis"


   If @lt(vergebnis,1) = @Ch(60)  
 {
 vErgebnis = @replfir(vErgebnis,@Ch(60),"")
 vwertungErgebnis = @Ch(60)  
}

WriteLn(vErgebnis)
WriteLn(vwertungErgebnis)
WriteLn("")

//or

     If @lt(vergebnis,1) = "<" then  
{
 vErgebnis = @replfir(vErgebnis,"<","")
 vwertungErgebnis = "<"  
}

WriteLn(vErgebnis)
WriteLn(vwertungErgebnis)

WriteLn("") 



Quote:
TestThis
<

TestThis
<


  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Replace Problem!
Reply #2 - Jun 26th, 2010 at 10:00am
Print Post Print Post  

Thank you Carl for your code. I have to say your method works better. 

  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Replace Problem!
Reply #3 - Jun 26th, 2010 at 6:28pm
Print Post Print Post  
Quote:
Thank you Carl for your code.

It's really your code, with a couple lines I added to it.  Wink
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged