Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Scroll

Don’t confuse the useful Scrolled event with this legacy command. While it’s a neat command, we don’t expect anyone to use it in VFP.

Usage

SCROLL nTopRow, nLeftCol, nBottRow,
       nRightCol, nRowChange [, nColChange ]

Parameter

Value

Meaning

nTopRow

Numeric

Top row of area to be scrolled.

nLeftCol

Numeric

Leftmost column of area to be scrolled.

nBottRow

Numeric

Bottom row of scrolled area.

nRightCol

Numeric

Rightmost column of area to be scrolled.

nRowChange

Numeric

Number of rows to move either up (negative) or down (positive).

nColChange

Numeric

Number of columns to scroll area either right (positive) or left (negative).

Text and images on the screen or active output window can be moved around using this command. Areas they leave behind are erased. Text and graphics that scroll beyond the specified boundaries are lost and cannot be retrieved by scrolling in the opposite direction.

Specifying an nRowChange value of zero with no nColChange value (or a value of zero) erases the area within the specified row and column boundaries. However, an nColChange setting of zero scrolls the area only vertically. We feel that specifying changes of zero ("no change") should result in, well, no change.

Visual FoxPro translates the rows and columns specified into those based on the current output font; funny effects can result from screens that may have looked okay in DOS. This command was developed long ago for DOS-based products; we’re surprised to find it works at all.

Example

CLEAR
@ 5,5 SAY "C:\WINDOWS\WINLOGO.BMP" BITMAP
@ 10, 10 SAY "Way Cool Effects" ;
         FONT "Times",16 STYLE "T" COLOR R+
SCROLL 0,0,20,15,2
SCROLL 5,16,20,21,-2
FOR i = 4 TO -8 STEP -1
  IF i # 0
    SCROLL 0,26-i,20,26-i,i*.1
  ENDIF
NEXT

See Also

@…Say