Question

I am using powerbuilder 11.5 using this method to set font weight of column name. What is ~t used for??.Why is it necessary to add it in statement. Without it error is thrown.

dw_1.Object.name.Font.Weight = &
    "700 ~t If(state = 'MA', 400, 700)"
Was it helpful?

Solution

~t is how you write a tab character into a string. In this case, it is being used to separate the default value from the expression.

Good luck,

Terry

OTHER TIPS

There are two options, a literal value or a computed value based on an expression, the ~t, tab or char(10), lets PowerBuilder know that's an expression, then you could use functions (systems or globals) and column names to build a dynamic value. The format is {default value}~t{expression}, the default value is not used, or just to render the preview in the IDE.

In addition to the 2 others answers, the tilda ~ is PB's escape character. It allows to use "special" characters in string literals :

  • ~t tabulation char
  • ~r carriage return
  • ~n newline
  • ~' if you need a single quote inside a single quoted string
  • ~" if you need a double quote inside a double quoted string
  • ~~ to have a regular tilda

~t is used for Tabulator I think. The PowerBuilder needs it because this is the separator between the default value and the datawindow syntax in your script!

Br. Gábor

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top