---
title: "Format Text specification"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518881281/Format%20Text%20specification"
format: markdown
---
> Macro (toc)

---

# Boolean

It specifies the formatting of <u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>. If the value of a parameter is True, a value of truetext will be used, a value of falsetext will be used otherwise. Values truetext and falsetext must be concluded between a pair of apostrophes. These apostrophes are not part of truetext or falsetext. Values truetext and falsetext must not contain the apostrophe character. 

Values truetext and falsetext are optional from the right. If they are not specified, the texts "True" or "False" are used. 

#### Syntax 

```visualbasic
"{L['TrueText'['FalseText']]}"
```

Note: Using **L** and **l** (small letter) is equivalent. 

#### Example 

```visualbasic
DebugPrintFormat("It is {L 'Monday' 'Tuesday'} today.", True) 
DebugPrintFormat("It is {L 'Monday' 'Tuesday'} today.", False)
```

It prints to the debug window: 

```visualbasic
It is Monday today. 
It is Tuesday today.
```

#### Example 

```visualbasic
Var Status As Boolean 

Status := True 
DebugPrintFormat("It is {L}.", Status) 
Status := False 
DebugPrintFormat("It is {L}.", Status)
```

It prints to the debug window: 

```visualbasic
It is True. 
It is False.
```

# Number

It specifies the formatting of <u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>, <u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> and <u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u>. 

#### Syntax 

```visualbasic
"{N[SignSpecifier][Precision]}"
```

Note: Using **N** and **n** is equivalent. 

#### SignSpecifier 

|  |  |
| --- | --- |
| Values | Description |
| empty | For negative signed values appear "–", for positive does not appear anything. |
| + | The sign appears always. |
| - | For negative signed values appear "–", for positive appears " " (space). |
| h | A hexadecimal format of a conversion is used. The floatpartspecification must be empty. Lower characters "abcdef" are used. **This flag is ignored for Double type variables.** |
| H | A hexadecimal format of a conversion is used. The floatpartspecification must be empty. Upper characters "ABCDEF" are used. **This flag is ignored for Double type variables.** |
| b | A binary format of a conversion is used. floatpartspecification must be empty. **This flag is ignored for Double type variables.** |

#### Example 

```visualbasic
DebugPrintFormat("{n}", 123) 
DebugPrintFormat("{n}", -123) 
DebugPrintFormat("{n+}", 123) 
DebugPrintFormat("{n+}", -123) 
DebugPrintFormat("{n-}", 123) 
DebugPrintFormat("{n-}", -123)
```

It prints to the debug window: 

```visualbasic
123 
-123 
+123 
-123 
 123 
-123
```

#### Example 

```visualbasic
DebugPrintFormat("{nh}", 123) 
DebugPrintFormat("{nh}", 12345678) 
DebugPrintFormat("{nH}", 12345678) 
DebugPrintFormat("{nb}", 123)
```

It prints to the debug window: 

```visualbasic
7b 
bc614e 
BC614E 
1111011
```

#### Precision 

```visualbasic
[0][beforedotcount][floatpartspecification]
```

***0**** *

Zero character adds zeros from the left. 

***beforedotcount**** *

It is the minimum number of characters of the number to be formatted. It is an integral number. It must be greater than zero. 

#### Example 

```visualbasic
DebugPrintFormat("{n}", 123) 
DebugPrintFormat("{n4}", 123) 
DebugPrintFormat("{n8}", 123) 
DebugPrintFormat("{n04}", 123) 
DebugPrintFormat("{n08}", 123)
```

It prints to the debug window: 

```visualbasic
123 
 123 
     123 
0123 
00000123
```

#### Example 

```visualbasic
DebugPrintFormat("{nH}", 123) 
DebugPrintFormat("{nH04}", 123) 
DebugPrintFormat("{nH08}", 123) 
DebugPrintFormat("{nb}", 123) 
DebugPrintFormat("{nb010}", 123)
```

It prints to the debug window: 

```visualbasic
7B 
007B 
0000007B 
1111011 
0001111011
```

#### floatpartspecification* *

|  |  |  |
| --- | --- | --- |
| Name | Parts/Values | Description |
| floatpartspecification | dotpart exppart |  |
| dotpart | empty | No effect. |
| **.**integralnumber | Number of decimal places to which the number is rounded. |
| exppart | empty | No effect. |
| e expspecification |  |
| expspecification | empty | No effect. |
| fillchar explen |  |
| explen | empty | No effect. |
| integralnumber |  |

#### Example 

```visualbasic
DebugPrintFormat("{n}", 123.456) 
DebugPrintFormat("{n.1}", 123.456) 
DebugPrintFormat("{n.2}", 123.456) 
DebugPrintFormat("{n.10}", 123.456)
```

It prints to the debug window: 

```visualbasic
123.456000 
123.5 
123.46 
123.4560000000
```

# Time - absolute

It specifies the formatting of absolute <u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u>. 

#### Syntax 

```visualbasic
"{#}"
```

#### Example 

```
DebugPrintFormat("{#}", #04/14/2009 18:55:05#) 
DebugPrintFormat("{#}", #04/14/2009 18:55:05.12#) 
DebugPrintFormat("{#}", #04/14/2009 18:55:05.123456#)
```

It prints to the debug window: 

```visualbasic
#04/14/2009 18:55:05.000000# 
#04/14/2009 18:55:05.120000# 
#04/14/2009 18:55:05.123456#
```

# Time - interval

It specifies the formatting of a <u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> interval. 

#### Syntax 

```visualbasic
"{:}"
```

#### Example 

```visualbasic
DebugPrintFormat("{:}", 18:55:05) 
DebugPrintFormat("{:}", 18:55:05.12) 
DebugPrintFormat("{:}", 18:55:05.123456)
```

It prints to the debug window: 

```visualbasic
18:55:05.000000 
18:55:05.120000 
18:55:05.123456
```

# Text

It specifies formatting of the <u>[Text](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u>. 

#### Syntax 

```visualbasic
"{T[Conversion][Justification]}"
```

Note: Using **T** and **t** is equivalent. 

#### Character conversion 

|  |  |
| --- | --- |
| Character | Output format |
| none | No conversion. |
| "U" | To uppercase. |
| "L" | To lowercase. |

#### Justification 

For function ParseText it is information about the length of a field. For function Formattext it is used for the alignment of a text in the box of a defined length. 

```visualbasic
[justifyspecification sizespecification]
```

|  |  |  |
| --- | --- | --- |
| Name | Parts/Values | Description |
| justifyspecification | jl | Left. |
| jc | Center. |
| jr | Right. |
| sizespecification | integralnumber |  |

#### Example 

```visualbasic
DebugPrintFormat("It is {t} today.", "Monday") 
DebugPrintFormat("It is {tu} today.", "Monday") 
DebugPrintFormat("It is {tl} today.", "Monday")
```

It prints to the debug window: 

```visualbasic
It is Monday today. 
It is MONDAY today. 
It is monday today.
```

# ByteString

It specifies formatting of <u>[ByteString](/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u>. 

#### Syntax 

```visualbasic
"{[CharacterEncoding]S}"
```

Note: Using **S** and **s** is equivalent. 

#### Character encoding – is supported from firmware 12.30. 

|  |  |
| --- | --- |
|  | Output format |
| None | ASCII encoding – byte from ByteString is used as a lower byte in destination text character |
| (ASCII) | ASCII encoding – byte from ByteString is used as a lower byte in destination text character |
| (UTF8) | The source ByteString is interpreted as UTF-8 and is converted to Text |

#### Example* *

```visualbasic
DebugPrintFormat("abc{s}de", &s"123\04\05\06\ff") 
DebugPrintFormat("{(UTF8)s}",&S"\C5\A1\C4\8D\C5\99\C5\BE") // character encoding is supported from firmware 12.30
```

It prints to the debug window: 

```none
abc123\04\05\06\FFde
ščřž
```

#### Syntax 

```visualbasic
"{Sh}"
```

Note: Using **S** and **s** is equivalent. Using **H** and **h** is equivalent. 

#### Example 

```visualbasic
DebugPrintFormat("abc{sh}de", &s"123\04\05\06\ff")
```

It prints to the debug window: 

```visualbasic
abc\31\32\33\04\05\06\ffde
```


# Character {

Character **{** determines a parameter declaration. To print it, it must be double: **{{** (then it does not determine a parameter declaration). Character **}** is printed normally. 

- **{{** prints **{**
- **}** prints **}**


#### Example 

```
Var dst As Text[100]
FormatText("Have a {{nice} trip.")
DebugPrint(dst)
```

It prints to the debug window: 

```
Have a {nice} trip. 
```