quotation marks "" How write to string/query

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

quotation marks "" How write to string/query

#1 Post by Victorio »

Hi,

How can I write character " to string ?

I want generate filter query this way :

KN_VLA is name of some database
pomvla is character variable, where is some name to filter in database, for example "SMITH JOHN"
drpx is next part of filter in character string, for example " .AND. AFIELD=10"

I want write this :
cQuery:="rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))="+pomvla+drpx
but and here and here must be "

in query is this :
rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))=NAGY .AND. (DRPC=2 .OR. DRPC=3 .OR. DRPC=4)

but I want this
rtrim(upper(lat_ibm(left(alltrim(kn_vla),50))))="NAGY" .AND. (DRPC=2 .OR. DRPC=3 .OR. DRPC=4)

How can I write it ?

In C language was this way to write characters /*, /" ,// and other

Now I an using chr(34), but I mean exist other way. I do not know, if in some other code page on PC (UTF8 or other may be problem with chr34.

User avatar
rdonnay
Site Admin
Posts: 4775
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: quotation marks "" How write to string/query

#2 Post by rdonnay »

There are 2 ways:

Code: Select all

cString := 'This is a string with a "word" quotated'

cString := [This is a string with a "word" quotated and another 'word' single-quotated]
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: quotation marks "" How write to string/query

#3 Post by Victorio »

Thank you

Post Reply