@ Function

Sets the cursor to a specified position on the terminal and generates video effects characters.

Syntax

@(column {,row })

@(code)

Syntax Elements

column is the column position on the current line to set the cursor to.

row is the line number on which to position the cursor. The default is the current line.

code generates an extended cursor addressing code or a video effects code.

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

Values of the expressions must be within the row and column limits defined by page width and depth set by the most recent execution of the TERM command.

The left-most column is numbered column 0: the top line is numbered line 0. Therefore, if the terminal screen is 80 columns wide, the columns are numbered 0 to 79.

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..."

If a Matrix printer is being used, the matrix parameter must be set to 1 using the TERM command. Rows and columns start at zero on the terminal and one on the Matrix printer.

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.
-6 Stop flashing.
-7 Start protect.
-8 Stop protect.
-9 Cursor-back sequence.
-10 Cursor-up sequence.
-11 Cursor on.
-12 Cursor off.
-13 Status line on.
-14 Status line off.
-15 Cursor forward.
-16 Cursor down.
-17 Enable slave port.
-18 Disable slave port.
-19 Screen dump.

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

Go to top buttonVideo 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 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)

Go to top button