Article ID 1237
Article Title DEFECT: Using comments // in DataFlex code strings
Article URL http://www.dataaccess.com/KBasePublic/KBPrint.asp?ArticleID=1237
KBase Category Visual DataFlex
Date Created 12/18/2000
Last Edit Date 08/08/2001


Article Text
PROBLEM:
- I am using a double-forward slash in a string variable in my DataFlex code, but the compiler won't compile. I always get the error message "ERROR 4345: Type check error" or similar errors.


EXPLANATION:
This is a Visual DataFlex/DataFlex compiler problem. The problem is that a double forward slash (//) is the comment marker in DataFlex code. Unfortunately, the compiler is unable to discern when to interpret // as a comment or just a plain string.

This problem does not affect comments in strings at runtime, such as text in database fields, only DataFlex programming code.


SOLUTION:
This defect is fixed in Dataflex 3.2 and Visual DataFlex 7 and will be fixed in WebApp Server 3.x.


WORKAROUND:
Do not use double forward slashes in a string or string variable. If you must use double forward slashes in a string, such as when typing a Web URL, concatenate the string from multiple strings.


EXAMPLE:

INCORRECT:
string sTmp
move "The URL of Data Access Worldwide's Web site is http://www.dataaccess.com ." to sTmp


CORRECT:
string sTmp
move ("The URL of Data Access Worldwide's Web site is http:/"+"/www.dataaccess.com .") to sTmp

ALSO CORRECT:
string sTmp
move "The URL of Data Access Worldwide's Web site is http:/" to sTmp
move (append(sTmp,"/www.dataaccess.com .")) to sTmp



Links Related to this Article
DAW Knowledge Base article 1236: DEFECT: Using exclamation point ! in DataFlex code strings

Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2024 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.