Example

This example flashes the status line five times, in yellow and blue. It does this by saving the foreground and background colors for the status line, setting them to blue and yellow, and then resetting them to their original values. It uses a loop to repeat this process five times, with colors changing once every second. This creates a flashing effect. The procedure must determine if the BackgndColor property is set to allow a separate background color on a per-attribute basis. If it isn't, it must allow it to do so (.BackgndColor = rcColorMapBackgnd), and remember to reset this value to its original value later (.BackgndColor = sepbc).

This example won't work unless you have a 5250 terminal session—or unless you simulate one with the demonstration 5250 host.

Sub FlashStatusLine ()

 With Session

 Dim i As Integer

 Dim bc As Integer

 Dim fc As Integer

 Dim sepbc As Integer

 

 bc = .BackgroundColor(rcStatusLine)

 fc = .ForegroundColor(rcStatusLine)

 sepbc = Session.BackgndColor

 

 For i = 1 To 5

 .BackgndColor = rcColorMapBackgnd

 .SetColorMap rcStatusLine, rcYellow, rcDkBlue

 

 .Wait "0:0:01"

 

 .BackgndColor = sepbc

 .SetColorMap rcStatusLine, fc, bc

 

 .Wait "0:0:01"

 Next i

 

 End With

End Sub