dbTalk Databases Forums  

String Replacement

comp.databases.pick comp.databases.pick


Discuss String Replacement in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert S. Lobel
 
Posts: n/a

Default String Replacement - 02-07-2007 , 07:33 PM






Is there any easy way in databasic to replace an 8 character string which is
part of a 400 character string with another 8 character string starting at a
specific location (say the 200th character)?
Rob



Reply With Quote
  #2  
Old   
douglas@pickteam.com
 
Posts: n/a

Default Re: String Replacement - 02-07-2007 , 08:40 PM






In classic pick

x = 200
TEST.STRING = TEST.STRING[1,X-1]:"12345678":TEST.STRING[X+8,9999]

I believe some flavors support TEST.STRING[X,8] = "12345678"


Reply With Quote
  #3  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: String Replacement - 02-07-2007 , 08:53 PM



"Robert S. Lobel" wrote:

Quote:
Is there any easy way in databasic to replace an 8 character string which is
part of a 400 character string with another 8 character string starting at a
specific location (say the 200th character)?
Rob
In D3:
VAR[200,8] = "12345678"

Or:
VAR = VAR[1,199]:"12345678":VAR[207,LEN(VAR)]

Does that help? Something tells me I'm missing something - or
something.
T


Reply With Quote
  #4  
Old   
Robert S. Lobel
 
Posts: n/a

Default Re: String Replacement - 02-07-2007 , 11:04 PM



Thanks Douglas & Tony. Tony's d3 solution is what I'm looking for.
Rob
"Tony Gravagno" <g6q3x9lu53001 (AT) sneakemail (DOT) com.invalid> wrote

Quote:
"Robert S. Lobel" wrote:

Is there any easy way in databasic to replace an 8 character string which
is
part of a 400 character string with another 8 character string starting at
a
specific location (say the 200th character)?
Rob

In D3:
VAR[200,8] = "12345678"

Or:
VAR = VAR[1,199]:"12345678":VAR[207,LEN(VAR)]

Does that help? Something tells me I'm missing something - or
something.
T



Reply With Quote
  #5  
Old   
douglas@pickteam.com
 
Posts: n/a

Default Re: String Replacement - 02-07-2007 , 11:47 PM



Tony is a hundred times smarter than me, but I believe his second
solution will overwrite the last character in the replacement string.

Got any more BASIC questions? I really like the string handling in
Pick BASIC.

Cheers



Reply With Quote
  #6  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: String Replacement - 02-08-2007 , 02:10 AM



doug wrote:

Quote:
Tony is a hundred times smarter than me,
HA! Fooled another one.
I just write a hundred times more than you. ;^b

Quote:
but I believe his second
solution will overwrite the last character in the replacement string.
It's funny that I did do the counting and still got it wrong. How
smart is that? Doh! Thanks for keeping me honest, bud.

T


Reply With Quote
Reply




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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.