Library Function



Library Function
Library Function: The function are the Pre-defined formula or program code to perform the specific task in the program.

The function provided by the QBASIC are called library function and the function created by the user are called user defined function.
Types
User defined function
Library function

1. LEFT$:
LEFT$ is a string function that allows us to extract the specific number of characters beginning from the left-most character of the string.
Example: a$= “computer”
               PRINT LEFT$(a$,5)
Output = COMPU

2. RIGHT$:
RIGHT$ is a string function that allows us to extract the specific number o characters beginning from the right-most character of the string.
Example: a$= “computer”
              PRINT RIGHT$ (a$,5)
Output = PUTER

3. MID$:
MID$ function returns a specific number of characters from a string.
Syntax= MID$( string expression,start,length)
Example: a$= “computer”
              PRINT MID$(a$,4,3)
Output : PUT

4. LEN:
LEN function returns the number of characters in a string or the number of bytes required by a variable.
Example:  a$= “computer”
                   Print LEN (A$)
                   OUTPUT= 8


5. LCASE$:
LCASE$ function converts all the uppercase characters in lowercase.
Example: a$= “COMPUTER”
               PRINT LCASE(a$)
           OUTPUT: computer


6. UCASE$:
UCASE$ function converts string to uppercase.
Example: a$= “computer”
               PRINT LCASE(a$)
           OUTPUT: COMPUTER


7. ASC:
ASC function converts a character or a string variable to its corresponding ASC II code. Only the first character of a string is evaluated by ASC function.

8. CHR$:
CHR$ function retrieves the single character represented by the ASC II number.

9. STR$:
STR$ function converts a string expression to its string representation.


10. VAL:
VAL function converts a string expression consisting of digits into numeric value.

11. LTRIM$:
LTRIM$ function removes leading blanks from the left side of the spring expression.               

12. RTRIM$:
RTRI$ function removes trailing blanks from the right side of the string expression .

13. STRING$:
STRING$ function is used with a PRINT statement to display a particular character a specific number of times.

14. INSTR:
INSTR function returns the position of the first occurrence of a string in another string.

15. DATE$:
DATE$ function returns the current system date of the computer and allow to set the current system date.


16. TIME$:
TIME$ function returns the current system time of computer and allows to set the current time.
17. INKEY$:
 INKEY$ function checks the keyboard looking for a pressed key.

18. INPUT$:
INPUT$ function halts execution until a specified number of characters are read from the keyboard or a disk file.

19. ABS:
ABS function is used to obtain the absolute value of a numeric expression.

20. COS:
COS function computes the cosign of an angle.

21. TAN:
TAN function is used to obtain the tangent of x.

22. SIN:
SIN function is used to obtain the sine o an angle.

23. INT:
INT function is used to round the number to the integer value.

24. CINT:
CINT function returns the nearest to the given number.

25.SGN:
SGN function returns the sign of a number.

26. SQR:
SQR function returns the square root  of a number.

27. TAB:
TAB function moves the text cursor to the specified print position.

28. SPC:
The SPC function skips a number of spaces when used with the PRINT and the LPRINT statement.



29. SPACE$:
The SPACE$ function is used to print a specific number of blank spaces.

30. LOCATE:
The LOCATE statement controls the cursor, placing it on the specific row and column on the screen.
******************Jayaganeshya********************************

Comments

Post a Comment

Popular posts from this blog

File Handling Important questions and Solutions

Test Result 2077/78

Full Form