NetTalk Central

Author Topic: NT vs DCT radio string choices with embedded quote  (Read 2508 times)

kevin

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
NT vs DCT radio string choices with embedded quote
« on: April 13, 2014, 02:10:41 PM »
Hi,  There is a difference in the way NT handles DCT string choices with an embedded quote and the way the C9 app handles them in the dictionary and designer/app generator.

C9 DCT allows a list choice (radio button) to have a value containing a single quotation (it must generate a double quote internally) so the variable use string contains a value with a single quote.

When NT generates the automatic validation it sticks to the rules requiring double quotes to represent one quote (because it is dealing with strings) so the valid C9 app DCT generates invalid automatic validation code.
Example:

In C9 DCT: Choices are coded as: Employer|Employer's Representative|Principal|Self Employed
This is a text field without a value specified. Designer's text property for the 2nd radio button is :     Employer's Representative.

In NT the automatic validation generates
  ! Automatic Dictionary Validation
    If InList ( clip ( OS4 : ReportCompletedByRepresenting ) , 'Employer' , 'Employer's Representative ','Principal ',' Self Employed ' ) = 0
      loc : Invalid = 'OS4:ReportCompletedByRepresenting'
      if not loc : alert then loc : Alert = p_web . translate ( 'OS4:ReportCompletedByRepresenting' ) & ' ' & clip ( p_web . site . InListText ) & p_web . _jsok ( '  Employer, Employer's Representative, Principal , Self Employed ').
      !exit
    End

Which generates an error.

I resolved this by substituting a <39> in the DCT string and both NT and Clarion handle this. Is there another way?

Thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT vs DCT radio string choices with embedded quote
« Reply #1 on: April 13, 2014, 11:00:42 PM »
probably best if you post a sample "bad" dictionary that generates the problem Kevin.

Cheers
Bruce