AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
Thank you Set :)

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 20:59
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] string difficulty

 

  

Den 07.12.2015 13:55, skrev 'checkmail'   
check_m...@satron.de 
[firebird-support]:
> .. and if the ID has the length of 15 chars and only the las * is for 
filling out to 16, i get a wrong result too.
>
> Can I compact my code?
>
> if(char_length(str)>16) then
> begin
> str = left(:str,16);
> while (k = 1) do
> begin
> if(right(str, 1) = '*') then
> begin
> str = left(str,char_length(str)-1);
> end
> else
> begin
> teil = str;
> k = 0;
> end
> end
> end
>
> (exept the one begin-end (only one command can be without..)
>

  
http://www.firebirdsql.org/refdocs/langrefupd25-intfunc-trim.html

Hence, I think your 16 lines above can be replaced by one simple line 
(if you use Fb 2.5):

str = trim (trailing '*' from left(:str, 16));

HTH,
Set





AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
Hello,

 

but this ist almost realized in my code, isn't it?

 

>From right until there is no * present

 

 

Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 23:28
An: firebird-support@yahoogroups.com
Betreff: RE: [firebird-support] string difficulty

 

  

How about working backwards through the string?

 

Andrew Zenz

 

  _  

From: firebird-support@yahoogroups.com

[mailto:firebird-support@yahoogroups.com] 
Sent: Tuesday, 8 December 2015 6:59 AM
To: firebird-support@yahoogroups.com
 
Subject: Re: [firebird-support] string difficulty

 

  

Den 07.12.2015 13:55, skrev 'checkmail'  
check_m...@satron.de 
[firebird-support]:
> .. and if the ID has the length of 15 chars and only the las * is for 
filling out to 16, i get a wrong result too.
>
> Can I compact my code?
>
> if(char_length(str)>16) then
> begin
> str = left(:str,16);
> while (k = 1) do
> begin
> if(right(str, 1) = '*') then
> begin
> str = left(str,char_length(str)-1);
> end
> else
> begin
> teil = str;
> k = 0;
> end
> end
> end
>
> (exept the one begin-end (only one command can be without..)
>

 
http://www.firebirdsql.org/refdocs/langrefupd25-intfunc-trim.html

Hence, I think your 16 lines above can be replaced by one simple line 
(if you use Fb 2.5):

str = trim (trailing '*' from left(:str, 16));

HTH,
Set





AW: AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
.. and if the ID has the length of 15 chars and only the las * is for filling 
out to 16, i get a wrong result too.

 

Can I compact my code?

 

  if(char_length(str)>16) then

  begin

str = left(:str,16);

while (k = 1) do

begin

  if(right(str, 1) = '*') then

  begin

str = left(str,char_length(str)-1);

  end

  else

  begin

   teil = str;

   k = 0;

  end

end

  end

 

(exept the one begin-end (only one command can be without..)

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 11:32
An: firebird-support@yahoogroups.com
Betreff: Re: AW: [firebird-support] string difficulty

 

  

select replace('ABC*DEFG01','**','') from RDB$DATABASE

 

 

On Monday, December 7, 2015 12:26 PM, "Virna Constantin  
<mailto:costel...@yahoo.com> costel...@yahoo.com [firebird-support]" < 
<mailto:firebird-support@yahoogroups.com> firebird-support@yahoogroups.com> 
wrote:

 

 

sorry, wrong response :(

 

 

 

On Monday, December 7, 2015 12:22 PM, "Virna Constantin  
<mailto:costel...@yahoo.com> costel...@yahoo.com [firebird-support]" < 
<mailto:firebird-support@yahoogroups.com> firebird-support@yahoogroups.com> 
wrote:

 

 

a quick answer :

m_char='**'

 

 

 

On Monday, December 7, 2015 12:12 PM, "'checkmail'  
<mailto:check_m...@satron.de> check_m...@satron.de [firebird-support]" < 
<mailto:firebird-support@yahoogroups.com> firebird-support@yahoogroups.com> 
wrote:

 

But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.

 

I have create this, is there a simpler way?

  

 

 

 

 





AW: AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
But in this case The comparision should be for two chars

 

while (ii<=iy) do

begin

if (position(substring(m_sir from ii for 2),m_char)=0) then

m_str=m_str||substring(m_sir from ii for 1);

ii=ii+1;

end

 

But, if the original ID like TEIL***ABC Then will be the three *** deletet, 
only the right * should be cut, this are the * who filled…

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 11:22
An: firebird-support@yahoogroups.com
Betreff: Re: AW: [firebird-support] string difficulty

 

  

a quick answer :

m_char='**'

 

 

 

On Monday, December 7, 2015 12:12 PM, "'checkmail'  
<mailto:check_m...@satron.de> check_m...@satron.de [firebird-support]" < 
<mailto:firebird-support@yahoogroups.com> firebird-support@yahoogroups.com> 
wrote:

 

But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.

 

I have create this, is there a simpler way?

  





Re: AW: [firebird-support] string difficulty

2015-12-07 Thread Virna Constantin costel...@yahoo.com [firebird-support]
select replace('ABC*DEFG01','**','') from RDB$DATABASE 


On Monday, December 7, 2015 12:26 PM, "Virna Constantin costel...@yahoo.com 
[firebird-support]"  wrote:
 

 #yiv7701085015 #yiv7701085015 -- #yiv7701085015 
.yiv7701085015ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv7701085015
 
div.yiv7701085015ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv7701085015 
div.yiv7701085015photo-title a, #yiv7701085015 div.yiv7701085015photo-title 
a:active, #yiv7701085015 div.yiv7701085015photo-title a:hover, #yiv7701085015 
div.yiv7701085015photo-title a:visited {text-decoration:none;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row 
{clear:both;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div {float:left;}#yiv7701085015 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv7701085015 
div.yiv7701085015ygrp-file {width:30px;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row div div a 
{text-decoration:none;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div div span {font-weight:normal;}#yiv7701085015 
div.yiv7701085015ygrp-file-title {font-weight:bold;}#yiv7701085015 
#yiv7701085015 

sorry, wrong response :(
 


On Monday, December 7, 2015 12:22 PM, "Virna Constantin costel...@yahoo.com 
[firebird-support]"  wrote:
 

 #yiv7701085015 -- 
.yiv7701085015ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv7701085015
 
div.yiv7701085015ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv7701085015 
div.yiv7701085015photo-title a, #yiv7701085015 div.yiv7701085015photo-title 
a:active, #yiv7701085015 div.yiv7701085015photo-title a:hover, #yiv7701085015 
div.yiv7701085015photo-title a:visited {text-decoration:none;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row 
{clear:both;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div {float:left;}#yiv7701085015 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv7701085015 
div.yiv7701085015ygrp-file {width:30px;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row div div a 
{text-decoration:none;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div div span {font-weight:normal;}#yiv7701085015 
div.yiv7701085015ygrp-file-title {font-weight:bold;}#yiv7701085015 

a quick answer :
m_char='**'

 


On Monday, December 7, 2015 12:12 PM, "'checkmail' check_m...@satron.de 
[firebird-support]"  wrote:
 
But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.
  I have create this, is there a simpler way?     #yiv7701085015 -- 
.yiv7701085015ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv7701085015
 
div.yiv7701085015ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv7701085015 
div.yiv7701085015photo-title a, #yiv7701085015 div.yiv7701085015photo-title 
a:active, #yiv7701085015 div.yiv7701085015photo-title a:hover, #yiv7701085015 
div.yiv7701085015photo-title a:visited {text-decoration:none;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row 
{clear:both;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div {float:left;}#yiv7701085015 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv7701085015 
div.yiv7701085015ygrp-file {width:30px;}#yiv7701085015 
div.yiv7701085015attach-table div.yiv7701085015attach-row div div a 
{text-decoration:none;}#yiv7701085015 div.yiv7701085015attach-table 
div.yiv7701085015attach-row div div span {font-weight:normal;}#yiv7701085015 
div.yiv7701085015ygrp-file-title {font-weight:bold;}#yiv7701085015 
#yiv7701085015 -- filtered {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 
4;}#yiv7701085015 filtered {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 
0;}#yiv7701085015 filtered {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 
0;}#yiv7701085015 filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 
4;}#yiv7701085015 filtered {panose-1:3 15 7 2 3 3 2 2 2 4;}#yiv7701085015 
filtered {font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;}#yiv7701085015 
filtered {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv7701085015 
p.yiv7701085015MsoNormal, #yiv7701085015 li.yiv7701085015MsoNormal, 
#yiv7701085015 div.yiv7701085015MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}#yiv7701085015 a:link, 
#yiv7701085015 span.yiv7701085015MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv7701085015 a:visited, #yiv7701085015 
span.yiv7701085015MsoHyperlinkFollo

Re: AW: [firebird-support] string difficulty

2015-12-07 Thread Virna Constantin costel...@yahoo.com [firebird-support]
sorry, wrong response :(
 


On Monday, December 7, 2015 12:22 PM, "Virna Constantin costel...@yahoo.com 
[firebird-support]"  wrote:
 

 #yiv0072394990 #yiv0072394990 -- #yiv0072394990 
.yiv0072394990ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv0072394990
 
div.yiv0072394990ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv0072394990 
div.yiv0072394990photo-title a, #yiv0072394990 div.yiv0072394990photo-title 
a:active, #yiv0072394990 div.yiv0072394990photo-title a:hover, #yiv0072394990 
div.yiv0072394990photo-title a:visited {text-decoration:none;}#yiv0072394990 
div.yiv0072394990attach-table div.yiv0072394990attach-row 
{clear:both;}#yiv0072394990 div.yiv0072394990attach-table 
div.yiv0072394990attach-row div {float:left;}#yiv0072394990 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv0072394990 
div.yiv0072394990ygrp-file {width:30px;}#yiv0072394990 
div.yiv0072394990attach-table div.yiv0072394990attach-row div div a 
{text-decoration:none;}#yiv0072394990 div.yiv0072394990attach-table 
div.yiv0072394990attach-row div div span {font-weight:normal;}#yiv0072394990 
div.yiv0072394990ygrp-file-title {font-weight:bold;}#yiv0072394990 
#yiv0072394990 

a quick answer :
m_char='**'

 


On Monday, December 7, 2015 12:12 PM, "'checkmail' check_m...@satron.de 
[firebird-support]"  wrote:
 
But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.
  I have create this, is there a simpler way?     #yiv0072394990 -- 
.yiv0072394990ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv0072394990
 
div.yiv0072394990ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv0072394990 
div.yiv0072394990photo-title a, #yiv0072394990 div.yiv0072394990photo-title 
a:active, #yiv0072394990 div.yiv0072394990photo-title a:hover, #yiv0072394990 
div.yiv0072394990photo-title a:visited {text-decoration:none;}#yiv0072394990 
div.yiv0072394990attach-table div.yiv0072394990attach-row 
{clear:both;}#yiv0072394990 div.yiv0072394990attach-table 
div.yiv0072394990attach-row div {float:left;}#yiv0072394990 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv0072394990 
div.yiv0072394990ygrp-file {width:30px;}#yiv0072394990 
div.yiv0072394990attach-table div.yiv0072394990attach-row div div a 
{text-decoration:none;}#yiv0072394990 div.yiv0072394990attach-table 
div.yiv0072394990attach-row div div span {font-weight:normal;}#yiv0072394990 
div.yiv0072394990ygrp-file-title {font-weight:bold;}#yiv0072394990 
#yiv0072394990 -- filtered {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 
4;}#yiv0072394990 filtered {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 
0;}#yiv0072394990 filtered {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 
0;}#yiv0072394990 filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 
4;}#yiv0072394990 filtered {panose-1:3 15 7 2 3 3 2 2 2 4;}#yiv0072394990 
filtered {font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;}#yiv0072394990 
filtered {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv0072394990 
p.yiv0072394990MsoNormal, #yiv0072394990 li.yiv0072394990MsoNormal, 
#yiv0072394990 div.yiv0072394990MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}#yiv0072394990 a:link, 
#yiv0072394990 span.yiv0072394990MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv0072394990 a:visited, #yiv0072394990 
span.yiv0072394990MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv0072394990 p 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv0072394990 code 
{}#yiv0072394990 pre 
{margin:0cm;margin-bottom:.0001pt;font-size:10.0pt;}#yiv0072394990 tt 
{}#yiv0072394990 span.yiv0072394990cat {}#yiv0072394990 span.yiv0072394990ct 
{}#yiv0072394990 span.yiv0072394990HTMLVorformatiertZchn 
{font-family:Consolas;}#yiv0072394990 p.yiv0072394990attach, #yiv0072394990 
li.yiv0072394990attach, #yiv0072394990 div.yiv0072394990attach 
{margin-right:0cm;margin-left:0cm;font-size:9.0pt;}#yiv0072394990 
p.yiv0072394990bold, #yiv0072394990 li.yiv0072394990bold, #yiv0072394990 
div.yiv0072394990bold 
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-weight:bold;}#yiv0072394990
 p.yiv0072394990green, #yiv0072394990 li.yiv0072394990green, #yiv0072394990 
div.yiv0072394990green 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;color:#628C2A;}#yiv0072394990
 p.yiv0072394990replbq, #yiv0072394990 li.yiv0072394990replbq, #yiv0072394990 
div.yiv0072394990replbq {margin:3.0pt;font-size:12.0pt;}#yiv0072394990 
p.yiv0072394990ad, #yiv0072394990 li.yiv0072394990ad, #yiv0072394990 
div.yiv0072394990ad 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv0072394990 
p.yiv0072394990underline, #yiv0072394990 li.yiv0072394990underline, 
#yiv00723

Re: AW: [firebird-support] string difficulty

2015-12-07 Thread Virna Constantin costel...@yahoo.com [firebird-support]
a quick answer :
m_char='**'

 


On Monday, December 7, 2015 12:12 PM, "'checkmail' check_m...@satron.de 
[firebird-support]"  wrote:
 
But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.
  I have create this, is there a simpler way?     #yiv8648735808 #yiv8648735808 
-- #yiv8648735808 
.yiv8648735808ygrp-photo-title{clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}#yiv8648735808
 
div.yiv8648735808ygrp-photo{background-position:center;background-repeat:no-repeat;background-color:white;border:1px
 solid black;height:62px;width:62px;}#yiv8648735808 
div.yiv8648735808photo-title a, #yiv8648735808 div.yiv8648735808photo-title 
a:active, #yiv8648735808 div.yiv8648735808photo-title a:hover, #yiv8648735808 
div.yiv8648735808photo-title a:visited {text-decoration:none;}#yiv8648735808 
div.yiv8648735808attach-table div.yiv8648735808attach-row 
{clear:both;}#yiv8648735808 div.yiv8648735808attach-table 
div.yiv8648735808attach-row div {float:left;}#yiv8648735808 p 
{clear:both;padding:15px 0 3px 0;overflow:hidden;}#yiv8648735808 
div.yiv8648735808ygrp-file {width:30px;}#yiv8648735808 
div.yiv8648735808attach-table div.yiv8648735808attach-row div div a 
{text-decoration:none;}#yiv8648735808 div.yiv8648735808attach-table 
div.yiv8648735808attach-row div div span {font-weight:normal;}#yiv8648735808 
div.yiv8648735808ygrp-file-title {font-weight:bold;}#yiv8648735808 
#yiv8648735808 #yiv8648735808 #yiv8648735808 -- _filtered #yiv8648735808 
{font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv8648735808 
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv8648735808 
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv8648735808 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv8648735808 
{panose-1:3 15 7 2 3 3 2 2 2 4;} _filtered #yiv8648735808 
{font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;} _filtered #yiv8648735808 
{font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv8648735808 
#yiv8648735808 p.yiv8648735808MsoNormal, #yiv8648735808 
li.yiv8648735808MsoNormal, #yiv8648735808 div.yiv8648735808MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}#yiv8648735808 a:link, 
#yiv8648735808 span.yiv8648735808MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv8648735808 a:visited, #yiv8648735808 
span.yiv8648735808MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv8648735808 p 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv8648735808 code 
{}#yiv8648735808 pre 
{margin:0cm;margin-bottom:.0001pt;font-size:10.0pt;}#yiv8648735808 tt 
{}#yiv8648735808 span.yiv8648735808cat {}#yiv8648735808 span.yiv8648735808ct 
{}#yiv8648735808 span.yiv8648735808HTMLVorformatiertZchn 
{font-family:Consolas;}#yiv8648735808 p.yiv8648735808attach, #yiv8648735808 
li.yiv8648735808attach, #yiv8648735808 div.yiv8648735808attach 
{margin-right:0cm;margin-left:0cm;font-size:9.0pt;}#yiv8648735808 
p.yiv8648735808bold, #yiv8648735808 li.yiv8648735808bold, #yiv8648735808 
div.yiv8648735808bold 
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-weight:bold;}#yiv8648735808
 p.yiv8648735808green, #yiv8648735808 li.yiv8648735808green, #yiv8648735808 
div.yiv8648735808green 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;color:#628C2A;}#yiv8648735808
 p.yiv8648735808replbq, #yiv8648735808 li.yiv8648735808replbq, #yiv8648735808 
div.yiv8648735808replbq {margin:3.0pt;font-size:12.0pt;}#yiv8648735808 
p.yiv8648735808ad, #yiv8648735808 li.yiv8648735808ad, #yiv8648735808 
div.yiv8648735808ad 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv8648735808 
p.yiv8648735808underline, #yiv8648735808 li.yiv8648735808underline, 
#yiv8648735808 div.yiv8648735808underline 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv8648735808 
span.yiv8648735808yshortcuts {}#yiv8648735808 p.yiv8648735808ad1, 
#yiv8648735808 li.yiv8648735808ad1, #yiv8648735808 div.yiv8648735808ad1 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv8648735808 
p.yiv8648735808ad2, #yiv8648735808 li.yiv8648735808ad2, #yiv8648735808 
div.yiv8648735808ad2 
{margin-right:0cm;margin-bottom:7.5pt;margin-left:0cm;font-size:12.0pt;}#yiv8648735808
 p.yiv8648735808underline1, #yiv8648735808 li.yiv8648735808underline1, 
#yiv8648735808 div.yiv8648735808underline1 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;text-decoration:underline;}#yiv8648735808
 span.yiv8648735808yshortcuts1 {font-weight:bold;}#yiv8648735808 
span.yiv8648735808yshortcuts2 {font-weight:normal;}#yiv8648735808 
span.yiv8648735808E-MailFormatvorlage36 
{color:#323E4F;font-weight:normal;font-style:normal;text-decoration:none 
none;}#yiv8648735808 .yiv8648735808MsoChpDefault {font-size:10.0pt;} _filtered 
#yiv8648735808 {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv8648735808 
div.yiv8648735808WordSection1 {}#yiv8648735808 _filtered #yiv8648735808 {} 
_filtered #yiv8648735808 {font-family:Symbol;} _filtere

AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
Hi,

 

first, thank you!

 

But it should only delete the right *

 

For example, the ID is ABCDEFG, the interface will tell me ABCDEFG*01 
In this case, from right, all * should deleted. 

 

But If the ID is ABC*DEFG, I get ABC*DEFG01 and in this case only all * 
from right should be deleted.

 

I have create this, is there a simpler way?

 

  begin

str = left(:str,16); -- only 16 digits, the other I don’t use here

while (k = 1) do

begin

  if(right(str, 1) = '*') then

  begin

str = left(str,char_length(str)-1);

  end

  else

  begin

   teil = str;

   k = 0;

  end

end

  end

 

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 09:56
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] string difficulty

 

  

How can I get ABC*DEFG, leave the * between C*D, delete all * from right?





 

 

SET TERM ^ ;

CREATE PROCEDURE DEL_CHAR (

M_SIR varchar(500),

M_CHAR varchar(10) )

RETURNS (

M_STR varchar(500) )

AS

declare ii smallint; 

declare iy smallint;

BEGIN

m_str='';

iy=char_length(m_sir);

ii=1;

while (ii<=iy) do

begin

if (position(substring(m_sir from ii for 1),m_char)=0) then

m_str=m_str||substring(m_sir from ii for 1);

ii=ii+1;

end

END^

SET TERM ; ^

 

m_sir='ABC*DEFG'

m_char='*'

 





AW: [firebird-support] string difficulty

2015-12-07 Thread 'checkmail' check_m...@satron.de [firebird-support]
Hi,

it is a sub-function an I get a string, I dont select it from a table. Our
customer should not use the * in the id, but he did. In the interface to the
cheer is set to it with filling *.

Thank you

-Ursprüngliche Nachricht-
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Gesendet: Montag, 7. Dezember 2015 10:09
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] string difficulty

Hi, using your code, how about left(:str,  position('**' in :str)-1));
select left(:str, position('**' in :str)-1)) from yourtable However, to make
things easier for future users, think about changing the single '*' to e.g.
'-' and then you can keep your existing select statements and not have this
problem when a new ABC*DEFG01 becomes ABC*DEFGHIJKLMN*01

Alan J Davies
Aldis


On 07/12/2015 08:29, 'checkmail' check_m...@satron.de [firebird-support]
wrote:
> Hello @ll,
>
> I have an input string ABCDEFG, filled with * to 16 chars, 
> ABCDEFG*, followed with zwo digits, f. e. 01
>
> ABCDEFG*01
>
> 01 can I cut for an other function, now I have ABCDEFG*
>
> The filled * I can delete for my real ID (ABCDEFG)
>
> left(:str,  position('*' in :str)-1));
>
> It works find, but there are IDs available with * in the middle of the 
> ID LFor example ABC*DEFG and I receive this: ABC*DEFG01
>
> In this case the function will return ABC
>
> How can I get ABC*DEFG, leave the * between C*D, delete all * from right?
>
> Thank you.
>
> Best regards
>
> Olaf
>
> 






++

Visit http://www.firebirdsql.org and click the Documentation item on the
main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links