Script Escape Characters

The following are the available escape characters:

 

Here is a short explanation of what can be done and what cannot be done and when the escaped characters should be used.

First some rules:
  1. WinBuilder Script Line Parameters are separated by a comma. If a comma is inside an argument, it must be 'escaped' by #$c

  2. Besides some special cases (e.g. parameters in ShellExecute) generally enclosing quotes are not needed.

  3. Enclosing quotes MUST be used if the WinBuilder Script Line Parameters contain spaces. If the spaces are replaced by the escape #$s, the enclosing quotes should be omitted.

In most cases user violation of the rules are accepted by WinBuilder and processed as assumed. E.g. unnecessary enclosing quotes or a comma inside an item enclosed by quotes.

But sometimes that can bring unexpected results.

Let me give an Example:

Item1,item2 is understood as two items, separated by the comma.

Item1#$citem2 is correctly written to have one item with the comma inside. "Item1,item2" is the same.

Now the problem-version:

Set,%Var%,"Item1","item2" cannot be understood uniquely by WinBuilder.

Let's exchange the English understandable words by the character 'x'

"xxxxx","xxxxx"

Are there two quote-enclosed xxxxx, separated by a comma? > Set,%Var%,xxxxx
Or is there on long string of 10 xes, interrupted by a nested quote pair containing a comma? > Set,%var%,xxxxx#$q#$c#$qxxxxx
Or is there on long string of 10 xes, interrupted by a nested quote pair 'escaping' a comma? > Set,%var%,xxxxx#$cxxxxx

You see how important it is to follow the rules, even if WinBuilder understands most violations correctly.