| Previous | Contents | Index |
| Example 11-10 SET HELP OFF statement |
|---|
line input 'Name', length 30: reply$ print _help set help off print _help end Name? HELP__________________________ 1 0 |
SET ICON 'str_exp'
|
| Example 11-11 SET ICON statement |
|---|
// dynamically change the taskbar icon set icon "c:\sheerpower\samples\smiley.ico" print "Check out the taskbar icon... it's a smiley!" delay set icon "c:\sheerpower\samples\frowny.ico" print "and now... it's changed to a frown!" end |
SET ICON changes the Icon displayed on the taskbar for each running SheerPower application. A unique icon can be specified for every SheerPower application. The icon can be dynamically changed during program execution.
ASK KEYSTROKES num_var
|
| Example 11-12 ASK KEYSTROKES statement |
|---|
input 'Please enter your name': name$ print 'Hello '; name$ ask keystrokes strokes print 'Keystrokes:'; strokes end Please enter your name? Maryanne Hello Maryanne Keystrokes: 8 |
ASK KEYSTROKES asks for the number of user-entered keystrokes.
ASK MARGIN num_var
|
ASK MARGIN finds the right margin of the device specified and assigns its value to the numeric variable num_var.
SET MARGIN num_expr
|
| Example 11-13 SET MARGIN statement |
|---|
print repeat$('.' ,200)
print
ask margin old_marg
input 'What do you want the margin set to': new_marg
set margin new_marg
print repeat$('.' ,200)
set margin old_marg
end
..................................................
..................................................
..................................................
..................................................
What do you want the margin set to? 20
....................
....................
....................
....................
|
SET MARGIN sets the right margin on the device specified to the number indicated. num_expr specifies the column to set the margin to. The margin must be greater than zonewidth.
ASK PAGESIZE num_var
|
| Example 11-14 ASK PAGESIZE statement |
|---|
ask pagesize no_lines print 'There are'; no_lines; 'lines or rows on this screen' end There are 24 lines or rows on this screen |
ASK PAGESIZE returns the number of rows or lines of screen output.
ASK RESPONSES num_var
|
| Example 11-15 ASK RESPONSES statement |
|---|
input 'Please enter your name': name$ input 'What day is this': what_day$ print 'Hello '; name$ print 'Have a good '; what_day$ ask responses answers print print 'Responses:'; answers end Please enter your name? Ginger What day is this? Wednesday Hello Ginger Have a good Wednesday Responses: 2 |
ASK RESPONSES asks for the number of completed input responses.
SET SCROLL num_expr1, num_expr2
|
| Example 11-16 SET SCROLL statement |
|---|
print at 21, 1: 'This text will not scroll.' set scroll 5, 20 print at 20, 1:; delay 1 print 'This' delay 1 print 'text' delay 1 print 'will' delay 1 print 'scroll.' delay 1 set scroll 1,24 end This text will scroll This text will not scroll. |
SET SCROLL statement sets up a scrolling region from line num_expr1 to line num_expr2.
RANDOMIZE
|
| Example 11-17 Randomize statement |
|---|
randomize
x = rnd
print x
end
run
.244013674718
run
.524856061388
|
RANDOMIZE gives the RND function a new starting point. This ensures a different random number sequence each time a program executes.
SheerPower uses a list of random numbers when the RND function is used. If no RANDOMIZE statement is used, SheerPower starts at the same place in this list each time the program executes. This means the same series of random numbers is returned each time the program executes.
RANDOMIZE tells SheerPower to pick a random starting point in the list. This ensures that a different series of random numbers is returned each time the program executes. (See Section 6.1.12, RND for information on the RND function.)
ASK SEED num_var
SET SEED num_expr
|
| Example 11-18 ASK/SET SEED statement |
|---|
randomize
ask seed seed_num
for i = 1 to 3
print rnd(1000)
next i
print 'Reset the random sequence'
set seed seed_num
for i = 1 to 3
print rnd(1000)
next i
end
608
88
506
Reset the random sequence
608
88
506
|
ASK SEED sets or resets the pseudo-random number sequence.
ASK SEED returns the current starting point of a pseudo-random sequence and stores the number in num_var.
SET SEED sets the starting point of a pseudo-random sequence with the number in num_expr.
There are a number of ASK SYSTEM and SET SYSTEM statements. These are described in the following sections. The ASK/SET statements ask about and set various system operation features.
ASK SYSTEM: COMMENT str_var
|
| Example 11-19 ASK SYSTEM: COMMENT statement |
|---|
set system: comment 'Invoice Entry' ask system: comment c$ print c$ end Invoice Entry |
The ASK SYSTEM: COMMENT statement asks for the SheerPower operating system comment for the process.
SET SYSTEM: COMMENT str_expr
|
| Previous | Next | Contents | Index |