Article ID 1755
Article Title BUG: Quotes inside of quotes do not work with Constrain command
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=1755
KBase Category Visual DataFlex
Date Created 12/23/2002
Last Edit Date 10/17/2003


Article Text
PROBLEM:
Double quotes do not work in OnConstrain events. Here are 2 examples:

1. A selection list with a constrain clause in the DD:

    Procedure OnConstrain
      String sTest
      Move ' "ABC" ' to sTest
      Forward Send OnConstrain
      Constrain BA0086.AUFTRAG_NR   eq sTest
    End_Procedure


2. In the second example Single holds 1 ASCII character:

for_all customer by index.1 //all Customers by Name
constrain Customer.Single eq '"'
//eq (Character(34)) doesn't work either
//eq sChar (where sChar = character(34))also doesn't work.
do
showln customer.Name
end_for_all

In each of these examples, the runtime error: Bad format of expression (operator). Error number 52 is generated.


EXPLANATION:
The expression parser of VDF cannot handle nested double quotes, so avoid using those. What happens in the examples above is that the value being evaluated (for example "ABC") is treated as a string literal. As such, it receives another set of quotes (i.e. now it looks like ""ABC""). Since nested double quotes are illegal, the expression parser generates the error.


WORKAROUND:
Use Constrain As instead of Constrain. Example 1. above would have
      Constrain BA0086.AUFTRAG_NR eq sTest
changed to
      Constrain BA0086 as (BA0086.AUFTRAG_NR eq sTest)


Contributed By:
Peter Bosch
Company: info trans Logistik Systems GmbH
email: pbosch@infotrans.at


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2017 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.