Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_blip( <cmessage>, <nrow>, <ncol> [, <ccolor> ] ) -- or -- n_blip( <cudf> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_BLIP( <cMessage>, <nRow>, <nCol> [, <cColor> ] ) -- or -- N_BLIP( <cUDF> )


Parameters

<cMessage>
Text to display. Cannot exceed 40 characters, including spaces; 
additional text will be truncated.

<nRow>
Row on which to display the message.

<nCol>
Column on which to display the message.

<cColor>
Standard and enhanced foreground/ background color sets. The color sets 
will alternate once per second as long as the message is displayed. For 
example, passing "G/W. R/B" will alternate the colors used to display 
the message between green on white and red on blue.

If this argument is omitted, the current standard and enhanced color 
sets will alternate.

<cUDF>
If the first character of the string is an equals sign (=), NetLib will 
assume that what follows is the name of a user-defined function to 
execute. The function can have only one parameter, the number of 
retries remaining, and must also return the number of retries 
remaining.


Returns
NIL


Description

This function specifies a message that will be displayed or a user- 
defined function that will be called whenever NetLib goes into a retry 
loop defined by N_TIMEOUT().

All settings remain in effect until changed by another call to 
N_BLIP(). To turn off the feature, pass a null string as the first 
parameter: N_BLIP("")

Calling N_BLIP() with a Message
The message <cMessage> will display at the cursor location defined by 
<nRow>, <nCol>, and the colors used to display it will alternate 
between the standard and enhanced color sets once per second.

If the message text includes a percent sign (%), NetLib will substitute 
the remaining number of seconds each time the display is updated. The 
substitution will begin at the % and will overwrite the next four 
characters. Thus

N_BLIP('Please wait % seconds.', 24, 1)

will display

Please wait   25conds.

assuming there are 25 seconds remaining. To avoid overwriting part of 
the message, embed four percent characters (%%%%) within the message:

N_BLIP('Please wait %%%% seconds.', 24, 1)

This will display the time remaining correctly, though with leading 
spaces:

Please wait   25 seconds.

Calling N_BLIP() with a UDF
If the string passed as the first and only argument begins with an 
equals sign (=), NetLib will assume that what follows is the name of a 
user-defined function. The function must accept one argument, the 
number of retries remaining, and must also return the number of retries 
remaining. The function will be called once per second as long as 
NetLib remains in a retry loop. It should pass back the same value it 
receives-the number of retries remaining-unless it specifically wants 
to increase or decrease the remaining time. (See the second example.)


Examples

// Blip with a message
N_BLIP('Trying to lock file ' + cFilespec, 24, 0)
N_TIMEOUT(10) // Retry ten times.

IF FLOCK()    // Retry loop until success or timeout.
   @ 24, 0 SAY 'File ' + cFilespec + ' locked.'

ELSE
   @ 24, 0 SAY 'Unable to lock file ' + cFilespec
ENDIF

// Blip with a UDF
N_BLIP('=MyTimer')
N_TIMEOUT(10) // Retry ten times.
IF RLOCK()    // Retry loop until success or timeout.
   @ 24, 0 SAY 'Record locked.'
ELSE
   @ 24, 0 SAY 'Unable to lock record.'
ENDIF
.
.
.
FUNCTION MyTimer
   PARAMETER nRemaining
   ? 'Tries remaining: ', nRemaining
   ? 'If you want to stop trying, press Escape.'
   IF INKEY() == 27
      nRemaining = 0
   ENDIF
RETURN (nRemaining)



See Also: N_TIMEOUT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson