|
|
#101 |
|
Moderator
|
SINKFUND
E r g e b n i s / R e s u l t
Sink Fund Factor. B e s c h r e i b u n g / D e s c r i p t i o n Code:
This program routine computes the Sink Fund Factor. The function is
defined by the following expression :
x
SinkFund(x,y) = --------------------
(x + 1.0)**y - 1.0
where x is the rate
and y is the term.SINKFUND can be called from Spreadsheet by inputting Code:
+call("sinkfund",x,y)x and y are either constants or cell references. Both the parameters and result are AP_BIGs. R e t u r n s The Sink Fund Factor B e i s p i e l / E x a m p l e Code:
+call("sinkfund",x,y) |
|
|
|
|
|
#102 |
|
Moderator
|
IOGETSTR
E r g e b n i s / R e s u l t
This routine retrieves a string from the serial port and places it into the typeahead buffer. This can be used to retrieve any size of string. B e s c h r e i b u n g / D e s c r i p t i o n S y n t a x Code:
CALL("IOGETSTR", PORT, BAUD, PARITY, DATABITS, STOPBITS, TERM, LEN, TIMEOUT)Code:
PORT is the comport to use. Either 1 or 2.
BAUD is the baud rate. Use appropriate value 0-7
Baud value
110 0
150 1
300 2
600 3
1200 4
2400 5
4800 6
9600 7
PARITY is the parity to be used. Use appropriate value 0-4
Baud value
NONE 0
ODD 1
EVEN 2
MARK 3
IGNORE 4
DATABITS is the number of data bits to be used. Use appropriate
value 0-3
DATA BITS 5 0
DATA BITS 6 1
DATA BITS 7 2
DATA BITS 8 3
STOPBITS is the number of stop bits to be used. Use appropriate
value 0-1
STOP BITS 1 0
STOP BITS 2 1
TERM is an integer of the ascii value of the terminating character.
If the string is terminated by a carriage return, TERM=13.
LEN is an integer of how many characters to read. Only use LEN if
the strings being sent are always a fixed length (the same size).
Max number of chars is <= 80 or whatever your application needs.
Use either LEN or TERM but not both. If the string size is variable
and a terminating character is sent, set LEN to 255 and TERM to the
number of the ascii terminating character.
TIMEOUT is the number in tenths of a second to wait for the incoming
string before timing out. If a timeout error occurs the function
returns.B e i s p i e l / E x a m p l e This will read a string from comport 1 until a CR(13) is read, with a baud=9600, no parity, 8 databits and 1 stop bit, timeout will be 20 seconds. Code:
CALL("IOGETSTR", 1, 7, 0, 3, 0, 13, 255, 200)Code:
CALL("IOGETSTR", 2, 4, 0, 3, 0, 0, 25, 100) |
|
|
|
|
|
#103 |
|
Moderator
|
PRTFUNCT: PRTNAME, TOTALLN, LINENO, LINELEN, PRTTYPE
E r g e b n i s / R e s u l t
Returns the requested printer information. B e s c h r e i b u n g / D e s c r i p t i o n This language call contains 5 printer functions which can be used with OAIII Programmer or Compiler to find out printer information. These functions are real handy for getting paper parameters from the current printer configuration. The PRINTER IS statement must have been executed before you can try these functions. S y n t a x To Execute from Programmer: Code:
PRINTER IS ""
pname = call ("PRTNAME");
total_lines = call ("TOTALLN");
cur_line = call ("LINENO");
line_width = call ("LINELEN");
ptype = call ("PRTTYPE");
PRINTER ENDR e t u r n s totalln - returns total number of lines per page lineno - returns the current line number on the page linelen - returns the characters per line prtname - returns the printer configuration name prttype - returns where the output is going printer, file, or console B e i s p i e l / E x a m p l e See above in Syntax-section. |
|
|
|
|
|
#104 |
|
Moderator
|
TYPECHAR
E r g e b n i s / R e s u l t
Place a character string into 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 TYPECHAR places the characters given in s in the Typeahead-buffer. S y n t a x Code:
value = call ('TYPECHAR' , keychars)keychars - Characters to place in the keyboard buffer. R e t u r n s BOOL: TRUE on success, FALSE on failure B e i s p i e l / E x a m p l e Code:
attach 'TYPAHEAD'
put call ('TYPECHAR' , 'ABCDE') ! places ABCDE in the keyboard buffer
detach 'TYPAHEAD' |
|
|
|
|
|
#105 |
|
Moderator
|
TYPEFKEY
E r g e b n i s / R e s u l t
The routine places the supplied 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 TYPEFKEY places the function key with the numer given in k in the typeahead-buffer. S y n t a x Code:
value = call ('TYPEFKEY' , fkeynum)fkeynum - Number of the function key whose keypress to place in the keyboard buffer The valid integer values that can be passed to the TYPEFKEY function are: 0 - UNDO 1 - HELP 2 - MENU 3 - PRINT 4 - SEARCH 5 - COPY 6 - CHANGE 7 - PASTE 8 - DESK TOP UTILITIES 9 - SELECT 10 - DO 11 - RETURN 12 - UP ARROW 13 - DOWN ARROW 14 - LEFT ARROW 15 - RIGHT ARROW 16 - TAB 17 - BACK TAB R e t u r n s BOOL: TRUE on success, FALSE on failure B e i s p i e l / E x a m p l e Code:
attach 'TYPAHEAD'
put call ('TYPEFEY' , 4) ! places a keypress to F4 in the keyboard buffer
detach 'TYPAHEAD' |
|
|
|
|
|
#106 |
|
Moderator
|
SEL_FN
E r g e b n i s / R e s u l t
The routine shows the file browsing dialog and returns the name of the selected file. B e s c h r e i b u n g / D e s c r i p t i o n SEL_FN is an interface to the OpenAccess internal File browsing dialog. It displays the file selection dialog, the available files in the list are filtered by the search mask given in msk. S y n t a x Code:
filename = call ('SEL_FN' , msk)msk - The search mask for the files the user can select, i.e. *.TXT or *.* R e t u r n s The full filename the user selected (i.e. MAIN:FILE.TXT) or an empty string, if the user cancelled. B e i s p i e l / E x a m p l e Code:
attach 'FILENAME'
put call ('SEL_FN' , '*.TXT') ! Shows the filename of the file the user selected
detach 'FILENAME' |
|
|
|
|
|
#107 |
|
Moderator
|
GET_FN
E r g e b n i s / R e s u l t
The routine shows the file open dialog and returns the name of the selected file. B e s c h r e i b u n g / D e s c r i p t i o n GET_FN is an interface to the OpenAccess internal File-Open dialog. It displays a window that asks the user for a filename and offers a file selector dialog via F4. The available files in the list are filtered by the search mask given in msk. S y n t a x Code:
filename = call ('GET_FN' , msk)msk - The search mask for the files the user can select, i.e. *.TXT or *.* R e t u r n s The full filename the user selected (i.e. MAIN:FILE.TXT) or an empty string, if the user cancelled. B e i s p i e l / E x a m p l e Code:
attach 'FILENAME'
put call ('GET_FN' , '*.TXT') ! Shows the filename of the file the user entered
detach 'FILENAME' |
|
|
|
|
|
#108 |
|
Moderator
|
DISP_DB
E r g e b n i s / R e s u l t
Display the F4 search window for Database files 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 displays the F4 search window. All database files are displayed ie .DF , .IF , .MF. Copying, deleting and renaming of the files is allowed. The searching order and filename are returned when a file is chosen but the extension is removed. A zero length string is returned if escape is pressed. S y n t a x Code:
string = call ('DISP_DB')There are no parameters for this procedure R e t u r n s A string containing a filename if the user selected a file or blank if they pressed escape. B e i s p i e l / E x a m p l e Code:
attach 'FILE'
a = call ('DISP_DB') ! a contains the name of the file the user
! selected from the <F4:search> window.
detach 'FILE'DISP_ALL |
|
|
|
|
|
#109 |
|
Moderator
|
DISP_ALL
E r g e b n i s / R e s u l t
Display the F4 search window for Database and other files 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 displays the F4 search window. All possible files are displayed. Copying, deleting and renaming of the files is allowed. The searching order, filename and extension are returned when a file is chosen or a zero length string if escape is pressed. S y n t a x Code:
string = call ('DISP_ALL')There are no parameters for this procedure R e t u r n s A string containing a filename if the user selected a file or blank if they pressed escape. B e i s p i e l / E x a m p l e Code:
attach 'FILE'
a = call ('DISP_ALL') ! a contains the name of the file the user
! selected from the <F4:search> window.
detach 'FILE'DISP_DB |
|
|
|
|
|
#110 |
|
Moderator
|
POSO
E r g e b n i s / R e s u l t
The routine returns the position of the given occurence of a substring in a string. B e s c h r e i b u n g / D e s c r i p t i o n POSO returns the 1-based position of the [occur]th occurence of lookfor in string str. S y n t a x Code:
place = call("poso",lookfor,str,occur)lookfor - The string to search str - The string that gets searched occur - Use the [occur]th occurence of lookfor in str R e t u r n s The 1-based position of lookfor in str or 0, if not found. B e i s p i e l / E x a m p l e Code:
attach "strfunc"
test = "harry~@jane~@Harryharryjennyharrynoodle~@"
put at 10,5 test
lookfor = "harry"
occur = 2
place = call("poso",lookfor,test,occur) ! will return 19 because function
put at 10,7 'The ', occur, ' occurrence of ', \\ ! is case sensitive
lookfor, ' is at ', place
lookfor = "~@"
occur = 3
place = call("poso",lookfor,test,occur) ! will return 40
put at 10,9 'The ', occur, ' occurrence of ', \\
lookfor, ' is at ', place
t = true
get t
put do clear screen
detach"strfunc" |
|
|
|