1. Paweł Kasperek
  2. PowerBuilder
  3. Tuesday, 5 November 2024 08:39 AM UTC

Hi,

 

How I can write superscript ex. x² in Datawindow UI components? Is possible to set superscript in any visual object in PowerBuilder? 

 

Regards,

Pawel

Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 5 November 2024 12:34 PM UTC
  2. PowerBuilder
  3. # 1

Hi.

You can display superscript in a column by using rtf style in edit properties of that column. Unfortunately the toolbar presented when editing a column with that style is limited! If you need the user to type data with superscript, I guess you need to request some enhancement.

Example showing some text with superscript.

Use the following sql to create a datawindow (hope the database you are using supports dummy or dual):

SELECT Cast('{\rtf1\ansi\pard ax{\super 3}+bx{\super 2}+cx=0.\par}' AS VARCHAR(2000)) AS a1
  FROM dummy; 

// or if your database supports dual:

SELECT Cast('{\rtf1\ansi\pard ax{\super 3}+bx{\super 2}+cx=0.\par}' AS VARCHAR(2000)) AS a1
  FROM dual; 

Set the column's (a1) edit style:

Retrieve the datawindow. You should see:

Explanation:

The rtf real commands are:

{\rtf1\ansi\pard ax{\super 3}+bx{\super 2}+cx=0.\par}

{\super [some text]}: shows text in superscript.

\pard is used to reset paragraph formatting.

\par will create a new line. If you omit it then you will have one line.

Of course all those require you understand how rtf format works and what "commands" it supports. You can google search to find more specific information. You can also check the following link which has some information about rtf: Application interchange file formats - tutorial.

One final point: rtf will require more space to be stored in a database column.

Andreas.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.