dbTalk Databases Forums  

UniVerse BASIC and Adding 2 Double Quotes or 2 Single Quotes to a string

comp.databases.pick comp.databases.pick


Discuss UniVerse BASIC and Adding 2 Double Quotes or 2 Single Quotes to a string in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Phillips
 
Posts: n/a

Default UniVerse BASIC and Adding 2 Double Quotes or 2 Single Quotes to a string - 12-13-2006 , 09:40 AM








I am creating a pipe delimited output file which will be used in a Microsoft
Word Mail Merge process. In general, it all works fine, except when I have
data like
Quote:
4'6"|
MSWord looks at double quotes ( " ) as a delimiter even though I have
specified | as the delimiter - and merge chokes. The ultimate resolution is
for the output file to look as follows:
Quote:
4'6""| or |4'6''|
Here's the problem - UniVerse BASIC will not let me do a CONVERT from " to
"" or '. No matter what I do the ouput only becomes " or '. For example:
CONVERT ' " ' TO ' " "' IN OUTREC ;
CONVERT ' " ' TO " ' ' " IN OUTREC ;
CONVERT ' " ' TO ' " ':' " ' IN OUTREC ;
CONVERT ' " ' TO " ' ":" ' " IN OUTREC ;

(note: Extra spaces between the quotes for clarity here. Not actually in
program.)

Also unsuccessfully tried variables in the CONVERT, and an EREPLACE
function.

Have a work around where I replace " with ~ and my MSWord macro changes ~ to
" in the final merged doc, but would prefer to fix the data on the output
side once. This change makes me compensate twice and also requires putting
the MSWord change on multiple machines.

Any help is greatly appreciated!!!
Patty


Patty - try this or something similar;

EQU SQ TO \'\
EQU DQ TO \"\

CONVERT SQ TO ...
CONVERT DQ TO ...


Sorry for posting out here, but the U2 group won't accect my reply. Hope you
get this.
Tom Phillips





Reply With Quote
  #2  
Old   
Chandru Murthi
 
Posts: n/a

Default Re: UniVerse BASIC and Adding 2 Double Quotes or 2 Single Quotes to a string - 12-13-2006 , 10:27 AM







"Tom Phillips" <squash (AT) computer (DOT) org> wrote

Quote:

I am creating a pipe delimited output file which will be used in a
Microsoft Word Mail Merge process. In general, it all works fine, except
when I have data like
|4'6"|

MSWord looks at double quotes ( " ) as a delimiter even though I have
specified | as the delimiter - and merge chokes. The ultimate resolution
is for the output file to look as follows:
|4'6""| or |4'6''|

Here's the problem - UniVerse BASIC will not let me do a CONVERT from " to
"" or '. No matter what I do the ouput only becomes " or '. For example:
CONVERT ' " ' TO ' " "' IN OUTREC ;
CONVERT ' " ' TO " ' ' " IN OUTREC ;
CONVERT ' " ' TO ' " ':' " ' IN OUTREC ; <- that's a Format of " under
", gok what it would do.
CONVERT ' " ' TO " ' ":" ' " IN OUTREC ; <- another Format !
There ain't no CONVERTs that work this way nowhere.
Convert does a 1-to-1 character replacement only.

What you need is CHANGE (on uv, think it's SWAP on others):
OUTREC = CHANGE(OUTREC, ' " ', ' "" ')
(spaces for clarity)

Chandru Murthi


Quote:
(note: Extra spaces between the quotes for clarity here. Not actually in
program.)

Also unsuccessfully tried variables in the CONVERT, and an EREPLACE
function.

Have a work around where I replace " with ~ and my MSWord macro changes ~
to " in the final merged doc, but would prefer to fix the data on the
output side once. This change makes me compensate twice and also requires
putting the MSWord change on multiple machines.

Any help is greatly appreciated!!!
Patty


Patty - try this or something similar;

EQU SQ TO \'\
EQU DQ TO \"\

CONVERT SQ TO ...
CONVERT DQ TO ...


Sorry for posting out here, but the U2 group won't accect my reply. Hope
you get this.
Tom Phillips






Reply With Quote
  #3  
Old   
Ross Ferris
 
Posts: n/a

Default Re: UniVerse BASIC and Adding 2 Double Quotes or 2 Single Quotes to a string - 12-14-2006 , 12:44 AM



You also might like to consider tab delimited files ... we haven't
chocked on " in years withy WordLynx


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.