@ Function

Generates control characters to either set the cursor to a specified position on the terminal screen or specify a video effect.

Syntax

@(column {,row })

@(code)

Syntax Elements

column The required column position; an integer greater than or equal to 0. If greater than the current maximum (set by the most recent execution of the TERM command), the cursor is placed in the right-most column.

row The required line number; an integer greater than or equal to 0. If greater than the current maximum (set by the most recent execution of the TERM command), the cursor is placed on the last row. The default, if omitted, is the current line.

code An extended cursor addressing code or a video effects code.

Note

All extended cursor addressing and video effects codes are negative integers.

Comments

The @ function, used with the PRINT and CRT statements, sets the cursor to a specified position on the terminal. The @ function can also be used to generate video effects on specified characters. These effects include bolding, dimming, underlining, blanking, flashing and reverse video (see video effects codes).

Operation

Screen column and rows are numbered starting at 0. The maximum column number is therefore width - 1 and the maximum row number height - 1.

The @ function cannot be used to format spooled printer output.

The @ function can appear anywhere that a legal expression is allowed, including assignment statements. For example:

@DIALOG = START = @(10,1)
.
.
PRINT START:"text..."

Go to top buttonExtended Cursor Addressing

To provide a consistent way of emitting terminal-independent character strings (such as clear to EOL), DataBasic supports an extended cursor addressing process. The @ function allows a single, negative parameter that returns the correct cursor control string for the terminal defined by TERMTYPE. The returned string is based on the following parameters:

Code

Operation

-1

Clear screen sequence including the number of pad characters specified in the FF delay field of the TERM settings.

-2

Cursor-home sequence.

-3

Clear-to-end-of-screen sequence.

-4

Clear-to-end-of-line sequence.

-5

Start flashing (see Note 2).

-6

Stop flashing (see Note 2).

-7

Start protect.

-8

Stop protect.

-9

Cursor-back sequence.

-10

Cursor-up sequence.

-11

Cursor on.

-12

Cursor off.

-13

Display the text that follows on the terminal's status line (usually line 25).

-14

Stop displaying text on the status line.

-15

Cursor forward.

-16

Cursor down.

-17

Enable slave port.

-18

Disable slave port.

-19

Screen dump.

-22

Start dimmed (see Note 2).

-23

Stop dimmed (see Note 2).

-24

Start underline (see Note 2).

-25

Stop underline (see Note 2).

-26

Start bold (see Note 2).

-27

Stop bold (see Note 2).

-28

Start blank.

-29

Stop blank.

-34

Start reversed (see Note 2).

-35

Stop reversed (see Note 2).

-60

White background colour.

-61

Brown background colour.

-62

Magenta background colour.

-63

Red background colour.

-64

Cyan background colour.

-65

Green background colour.

-66

Blue background colour.

-67

Black background colour.

-68

White foreground colour (full intensity).

-69

Brown foreground colour (full intensity).

-70

Magenta foreground colour (full intensity).

-71

Red foreground colour (full intensity).

-72

Cyan foreground colour (full intensity).

-73

Green foreground colour (full intensity).

-74

Blue foreground colour (full intensity).

-75

Black foreground colour (full intensity).

-84

White foreground colour (low intensity).

-85

Brown foreground colour (low intensity).

-86

Magenta foreground colour (low intensity).

-87

Red foreground colour (low intensity).

-88

Cyan foreground colour (low intensity).

-89

Green foreground colour (low intensity).

-90

Blue foreground colour (low intensity).

-91

Black foreground colour (low intensity).

Note

  1. The effects of these codes can be changed with the @ compatibility option.

  2. The codes to start and stop video effects (flashing, dimmed, underline, bold and reversed) normally switch on or off the effect concerned and switch off all the others. This behaviour can be changed with the CURSOR.ATTRIBUTES environment option.

Different terminal types are specified via the TERM or SSM command (refer to Terminal Types).

Go to top button Video Effects

The table below lists the video effects that can be achieved using the @ function. These codes send an eight-bit character to the terminal.

The video effects can also be achieved by using the code (without the minus sign) as the value in a CHAR() function. PRINT CHAR(130) is the same as PRINT @(-130). The same is not true for extended cursor addressing codes.

All of the video effects shown in the table may not work with all terminals. For example, one terminal may not provide for Dimmed and Blanked Video while another will not provide for Bold Video. Consult the appropriate terminal documentation for complete information.

Video Effects Codes

Code

Bold

Underlined

Blanked

Reversed

Flashing

Dimmed

Code

-128

This is video off.

-128

-129

 

 

 

 

 

Dimmed

-129

-130

       

Flashing

 

-130

-131

       

Flashing

Dimmed

-131

-132

     

Reversed

   

-132

-133

     

Reversed

 

Dimmed

-133

-134

     

Reversed

Flashing

 

-134

-135

     

Reversed

Flashing

Dimmed

-135

-136

   

Blanked

     

-136

-137

   

Blanked

   

Dimmed

-137

-138

   

Blanked

 

Flashing

 

-138

-139

   

Blanked

 

Flashing

Dimmed

-139

-140

   

Blanked

Reversed

   

-140

-141

   

Blanked

Reversed

 

Dimmed

-141

-142

   

Blanked

Reversed

Flashing  

-142

-143

   

Blanked

Reversed

Flashing

Dimmed

-143

-144

 

Underlined

       

-144

-145

 

Underlined

     

Dimmed

-145

-146

 

Underlined

   

Flashing

 

-146

-147

 

Underlined

   

Flashing

Dimmed

-147

-148

 

Underlined

  Reversed    

-148

-149

 

Underlined

 

Reversed

 

Dimmed

-149

-150

 

Underlined

 

Reversed

Flashing

 

-150

-151

 

Underlined

 

Reversed

Flashing

Dimmed

-151

-152

 

Underlined

Blanked

     

-152

-153

 

Underlined

Blanked

   

Dimmed

-153

-154

 

Underlined

Blanked

 

Flashing

 

-154

-155

 

Underlined

Blanked

 

Flashing

Dimmed

-155

-156

 

Underlined

Blanked

Reversed

   

-156

-157

  Underlined

Blanked

Reversed

 

Dimmed

-157

-158

 

Underlined

Blanked

Reversed

Flashing

 

-158

-159

 

Underlined

Blanked

Reversed

Flashing

Dimmed

-159

-160

Bold

         

-160

-161

Bold

       

Dimmed

-161

-162

Bold

     

Flashing

 

-162

-163

Bold

     

Flashing

Dimmed

-163

-164

Bold

   

Reversed

   

-164

-165

Bold

   

Reversed

 

Dimmed

-165

-166

Bold

   

Reversed

Flashing

 

-166

-167

Bold

   

Reversed

Flashing

Dimmed

-167

-168

Bold

 

Blanked

     

-168

-169

Bold

 

Blanked

   

Dimmed

-169

-170

Bold

 

Blanked

 

Flashing

 

-170

-171

Bold

 

Blanked

 

Flashing

Dimmed

-171

-172

Bold

 

Blanked

Reversed

   

-172

-173

Bold

 

Blanked

Reversed

 

Dimmed

-173

-174

Bold

 

Blanked

Reversed

Flashing

 

-174

-175

Bold

 

Blanked

Reversed

Flashing

Dimmed

-175

-176

Bold

Underlined

       

-176

-177

Bold

Underlined

      Dimmed

-177

-178

Bold

Underlined

   

Flashing

 

-178

-179

Bold

Underlined

   

Flashing

Dimmed

-179

-180

Bold

Underlined

 

Reversed

   

-180

-181

Bold

Underlined

 

Reversed

 

Dimmed

-181

-182

Bold

Underlined

 

Reversed

Flashing

 

-182

-183

Bold

Underlined

 

Reversed

Flashing

Dimmed

-183

-184

Bold

Underlined

Blanked

     

-184

-185

Bold

Underlined

Blanked

   

Dimmed

-185

-186

Bold

Underlined

Blanked

 

Flashing

 

-186

-187

Bold

Underlined

Blanked

 

Flashing

Dimmed

-187

-189

Bold

Underlined

Blanked

Reversed

 

Dimmed

-189

-190

Bold

Underlined

Blanked

Reversed

Flashing

 

-190

-191

Bold

Underlined

Blanked

Reversed

Flashing

Dimmed

-191

Go to top buttonMultiValue Compatibility

Refer to @ Function (MultiValue compatibility).

Example 1

This example clears the screen and prints the heading "MAIN MENU" at the top of screen starting at the 35th column.

HEAD = @(35,0):"MAIN MENU":@(35,1)
PRINT @(-1),HEAD

Example 2

This example clears the screen and prints a bold and flashing "MAIN MENU" at the top of the screen:

HEAD = "MAIN MENU"
PRINT @(-1):@(-162),HEAD:@(-128)