Antwort schreiben...
 
Themen-Optionen Thema durchsuchen
Alt 12.10.2012, 01:35   #131
leecher
Moderator
FORCED1

E r g e b n i s / R e s u l t

Places today's date in the keyboard buffer eg. 31/12/1996

B e s c h r e i b u n g / D e s c r i p t i o n

This function is designed to be allocated to one of the user defined
function keys, for example to Shift F1.

Pressing Shift F1 will place today's date in the keyboard buffer in the
default date format.

The function makes a useful means of datestamping a notepad, document
or memo field.

S y n t a x

Place this routine in a user defined function key like so -

Code:
\CFORCED1\!
\C means load the C Hook interface
FORCED1 is the name of the function to invoke
\! is equivalent to <do:F10>

To datestamp a field, press Shift + the function key


P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

A boolean value and places today's date in the keyboard buffer.

B e i s p i e l / E x a m p l e

Q u e r v e r w e i s / C r o s s R e f e r e n c e
FORCED2
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:37   #132
leecher
Moderator
FORCED2

E r g e b n i s / R e s u l t

Places today's date in the keyboard buffer eg. 21st April

B e s c h r e i b u n g / D e s c r i p t i o n

This function is designed to be allocated to one of the user defined
function keys, for example to Shift F1.

Pressing Shift F1 will place today's date in the keyboard buffer in the
full date format eg. 31st December 1996

The function makes a useful means of datestamping a notepad, document
or memo field.

S y n t a x

Place this routine in a user defined function key like so -

Code:
\CFORCED2\!
\C means load the C Hook interface
FORCED2 is the name of the function to invoke
\! is equivalent to <do:F10>

To datestamp a field, press Shift + the function key


P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

A boolean value and places today's date in the keyboard buffer.

B e i s p i e l / E x a m p l e

Q u e r v e r w e i s / C r o s s R e f e r e n c e
FORCED1
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:38   #133
leecher
Moderator
FORCET1

E r g e b n i s / R e s u l t

Places the time in the keyboard buffer eg. 10:03:54 AM

B e s c h r e i b u n g / D e s c r i p t i o n

This function is designed to be allocated to one of the user defined
function keys, for example to Shift F1.

Pressing Shift F1 will place the time in the keyboard buffer in the
default time format.

The function makes a useful means of timestamping a notepad, document
or memo field.

S y n t a x

Place this routine in a user defined function key like so -

Code:
\CFORCET1\!
\C means load the C Hook interface
FORCET1 is the name of the function to invoke
\! is equivalent to <do:F10>

To timestamp a field, press Shift + the function key

P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

A boolean value and places the time in the keyboard buffer.

B e i s p i e l / E x a m p l e

Q u e r v e r w e i s / C r o s s R e f e r e n c e
FORCET2
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:39   #134
leecher
Moderator
FORCET2

E r g e b n i s / R e s u l t

Places the time in the keyboard buffer eg. 10:03

B e s c h r e i b u n g / D e s c r i p t i o n

This function is designed to be allocated to one of the user defined
function keys, for example to Shift F1.

Pressing Shift F1 will place the time in the keyboard buffer in a
reduced format of hh:mm.

The function makes a useful means of timestamping a notepad, document
or memo field.

S y n t a x

Place this routine in a user defined function key like so -

Code:
\CFORCET2\!
\C means load the C Hook interface
FORCET2 is the name of the function to invoke
\! is equivalent to <do:F10>

To timestamp a field, press Shift + the function key

P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

A boolean value and places the time in the keyboard buffer.

B e i s p i e l / E x a m p l e

Q u e r v e r w e i s / C r o s s R e f e r e n c e
FORCET1
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:41   #135
leecher
Moderator
GETTAMT

E r g e b n i s / R e s u l t

Report how many characters are in the keyboard buffer

B e s c h r e i b u n g / D e s c r i p t i o n

While the normal Open Access keyboard buffer is 64 characters long, it
would be possible to overflow it using the STRSTUFF and KEYSTUFF
routines.

Before stuffing a large string into the keyboard buffer it is a good
idea to check how much space remains. GETTAMT (get type ahead amount)
returns the amount of space free in the keyboard buffer.

S y n t a x

Code:
value = call('GETTAMT')
P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

An integer containing the amount of free space in the keyboard buffer.

B e i s p i e l / E x a m p l e

Code:
attach 'KEYBOARD'
a = call('GETTAMT')     ! a contains 64 
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
STRSTUFF
KEYSTUFF
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:43   #136
leecher
Moderator
GET_CH

E r g e b n i s / R e s u l t

Get a single character from the keyboard, without echo

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure returns a character to the calling program. It does not
echo the character typed to the screen, so it is ideal for 'one key'
responses.

The developer can prompt the user to type 'Y or N' and this routine
will immediately return the key pressed. The user does not have to
type 'Y' followed by F10.

S y n t a x

Code:
string = call('GET_CH')
P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

The procedure returns a string value.

Usually the string returned is the character typed by the user. However,
if the user presses <do:F10>, then the string returned is 'F10'.

Similarly, pressing <help:F1> returns F1 etc. Pressing <undo:Esc> returns
Esc.

B e i s p i e l / E x a m p l e

Code:
attach 'KEYBOARD'
put 'Please press Y or N to continue' , do newline 
a = call ('GET_CH')        ! get a single key press 
if a = 'Y'
   put 'You pressed Y'
else
   put 'You did not press y'
end if
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CHE
FLUSHBUF
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:44   #137
leecher
Moderator
GET_CHE

E r g e b n i s / R e s u l t

Get a single character from the keyboard, with echo

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure returns a character to the calling program. The character
typed is echoed to the screen, so it is ideal for 'one key' menus.

Otherwise, this routine is identical to GET_CH.

S y n t a x

Code:
string = call('GET_CHE')
P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

The procedure returns a string value.

Usually the string returned is the character typed by the user. However,
if the user presses <do:F10>, then the string returned is 'F10'.

Similarly, pressing <help:F1> returns F1 etc. Pressing <undo:Esc> returns
Esc.

B e i s p i e l / E x a m p l e

Code:
attach 'KEYBOARD'
put 'Please press Y or N to continue' , do newline 
a = call ('GET_CHE')        ! get a single key press and echo it to
			    ! the screen 
if a = 'Y'
   put 'You pressed Y'
else
   put 'You did not press y'
end if
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CH
FLUSHBUF
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:45   #138
leecher
Moderator
ISKEY

E r g e b n i s / R e s u l t

Is there a key waiting in the keyboard buffer ?

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure tells the calling program if there is a key waiting
in the keyboard buffer.

This allows an Open Access program to prompt the user for a response and
then, if no key is waiting, run another part of the program. Using the
time a user is thinking for additional processing is the start of
multitasking.

S y n t a x

Code:
boolean = call('ISKEY')
P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

The procedure returns a Boolean or True/False value.

TRUE - there is a key waiting in the buffer
FALSE - there is nothing in the keyboard buffer

B e i s p i e l / E x a m p l e

Code:
attach 'KEYBOARD' 
x = true
put 'Do you want to continue ?'
! as long as the keyboard buffer is empty, this loop will be active
while not call("ISKEY")
   do somethingelse
end while 
! the user has pressed <do:F10> or <undo:Esc> so get the value from the 
! keyboard buffer
get x 
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CH
GET_CHE
FLUSHBUF
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:47   #139
leecher
Moderator
KEYSTUFF

E r g e b n i s / R e s u l t

Put a function key in the keyboard buffer.

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure places a function key in the keyboard buffer for you. You
must specify the key to be inserted.

Function keys F1..F10 and Esc may be inserted along with Alt F1 to F10,
Shift F1 - F10 and numerous other cursor keys.

Using this function with STRSTUFF lets you write macros from inside
your programs.

S y n t a x

Code:
bool = call('KEYSTUFF' , key_value)
P a r a m e t e r

key_value - This procedure accepts an integer value.

0 = <undo:esc>
1 = <help:F1>
2 = <menu:F2>
3 = <print:F3>
4 = <search:F4>
5 = <copy:F5>
6 = <change:F6>
7 = <paste:F7>
8 = <desk:F8>
9 = <select:F9>
10 = <do:F10>

11 = <hypertext:Alt F1>
12 =
13 = <printscreen:Alt F3>
14 = <ascii:Alt F4>
15 = <cut:Alt F5>
16 = <format:Alt F6>
17 = <place:Alt F7>
18 = <macro:Alt F8>
19 = <deselect:Alt F9>
20 = <execute:Alt F10>

21 = <user1:Shift F1>
22 = <user2:Shift F2>
23 = <user3:Shift F3>
24 = <user4:Shift F4>
25 = <user5:Shift F5>
26 = <user6:Shift F6>
27 = <user7:Shift F7>
28 = <user8:Shift F8>
29 =
30 =

31 = <backspace>
32 = <tab>
33 = <backtab>
34 = <up>
35 = <down>
36 = <left>
37 = <right>
38 = <home>
39 = <end>
40 = <line_start>
41 = <line_end>
42 = <word_forward>
43 = <word_backward>
44 = <page_up>
45 = <page_down>
46 = <insert>
47 = <delete>
48 = <line_insert>
49 = <line_delete>
50 = <return>

If you want to place several keys in the keyboard buffer,
then you must 'KEYSTUFF' them in reverse order. The
keyboard buffer is a LIFO stack - Last in, First Out.

To call up the print window and print, you would normally
type F3, F10. Using this routine, you would stuff F10 and
then F3. At the next pause for keyboard input the
'keystuffed' keys take effect.

R e t u r n s

The procedure returns a Boolean or True/False value.

TRUE - the procedure worked correctly.
FALSE - a problem occurred.

B e i s p i e l / E x a m p l e

Code:
! get the keyboard utilities 
attach 'KEYBOARD'
! force the ascii table to appear - Alt F4
x = call ('KEYSTUFF' , 14)
! remove the utilities from memory
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CH Get character without echoing it to the screen.
GET_CHE Get a character with echo.
FLUSHBUF Clear out the keyboard buffer.
STRSTUFF Place a string in the keyboard buffer.
leecher ist offline   Mit Zitat antworten
Alt 12.10.2012, 01:49   #140
leecher
Moderator
PASSWORD

E r g e b n i s / R e s u l t

Prompts the user for a string, echoing '*' to the screen

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure is used to prompt the user for a string and does not
display that string on the screen. Instead, it displays a '*' for each
character typed.

Using this function the user can prompt for a secret password, knowing
that nothing will appear on the screen.

S y n t a x

Code:
password = call('PASSWORD' , length)
P a r a m e t e r

length - An integer parameter specifying the maximum length of the
password is passed to this function.

If the user tries to type a string longer than the parameter,
the computer will beep.

R e t u r n s


The procedure returns a string value. This is the string typed by
the user.

If the user presses Escape, a zero length string is returned.

If the user presses Enter or F10 on a blank password, then a 1 character
space is returned.

B e i s p i e l / E x a m p l e

Code:
! This routine demonstrates how to use the Open Access 'C' Language
! routine PASSWORD. 

! attach the c hook 
attach "keyboard"
done = false
! loop until escape is pressed
while not done
! prompt the user
   put at 10,10 mode title 'Please enter your password: '  
! call the password routine.  It returns a string, in this case into the
! variable a.  The password width is set to 8.
   a = call("password",8)
! users of the Compiler please note that the above command would be
! a = (* str) call("password",8)
   put do newline 
   put do newline 
   put do newline 
! display the password just typed in
   put mode normal length(a) , ' ' , a , do clear end line 
   put do newline 
   put do newline 
   put do newline 
! was escape pressed ?  If so end the loop
   if length (a) = 0
      done = true
   end if
end while 
! remove the c hook from memory
detach "keyboard"
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CH
GET_CHE
FLUSHBUF
leecher ist offline   Mit Zitat antworten


Antwort schreiben...

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche