Simplicty and flexibility!


how to handle doubble quotes


Started by Roar Andersen
Search
You will need to Sign In to be able to add or comment on the forum!

how to handle doubble quotes

This string  - if(stock = "No" and stock < "1" , "<br><img src=''images/nostockitem.gif''>" , blank ) -  has double quotes and that don't work's in DE. Double asterisk can not be used as it is interpreted as two characters. How to handle double quotes in DE8? 


Written by Roar Andersen 07/10/18 at 23:52:14 Dataease [{8}]FIVE

Re:how to handle doubble quotes

In DataEase 8.5 you have StringEscape()
http://www.dataease.com/dg3_HelpView/?PageID=13734...

This will escape a sequence into the correct character i.e. /' to " etc.

All string functions in 8.5 has this built in too so you only need to replace " in the string to /' and it should be fine.

if(stock = "No" and stock < "1" , "<br><img src=/'images/nostockitem.gif/'>" , blank ) 

In just this example you can replace " with ' in HTML and it will have the same interpretation but that is a different matter... there is plenty of other cases where you need to be able to include a double quote in a DataEase string.

In versions prior to 8.5 you can use chr(34) in a concat to achieve the same but obviously that is more cumbersome.

if(stock = "No" and stock < "1" , concat("<br><img src=",chr(34),"images/nostockitem.gif",chr(34),">") , blank ) 


Written by DataEase 09/10/18 at 13:14:39 Dataease [{8}]FIVE