Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Function and Procedures in Visual Basic 6.0: Understanding the Differences, Study notes of Computer Science

An overview of functions and procedures in Visual Basic 6.0, explaining their differences, syntax, and usage. Functions are blocks of code that perform a specific task and return a result, while procedures are blocks of statements that perform a particular task without returning a result. passing arguments by reference and value, types of procedures, and calling procedures.

Typology: Study notes

2019/2020

Uploaded on 01/20/2020

akulaaruna
akulaaruna 🇮🇳

1 document

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
VISUAL BASIC 6.0
Function And Procedures
By Pragya Ratan Sagar
pf3
pf4
pf5

Partial preview of the text

Download Function and Procedures in Visual Basic 6.0: Understanding the Differences and more Study notes Computer Science in PDF only on Docsity!

VISUAL BASIC 6.

Function And Procedures

By Pragya Ratan Sagar

Functions

It is a separate procedure that can take arguments, perform a series of statements and change the value of its argument or Functions are named blocks program code that perform a specific task and return a result. The task can be as simple as adding two numbers or as complex as launching a spacecraft

Syntax: Function FunctionName(argument list) As Datatype VB statements.... End Function 1

Procedures

Procedure is a block of statements which performs a particular task, just that it does not return a result Syntax: [Private|Public] Sub ProcedureName(argument list) VB Statements.... End Sub

Types of procedures:

1. General Procedure General procedure is one that we create for our own specific purpose. 2. Event Procedure Event procedure is a procedure associated with the event of an object and are named in a way that indicates both event and object clearly.

3

Calling a Procedure Procedure are called with or without the keyword call Syntax: …. Call procedurename() ….

Example: Private Sub clearcontrols() Text1.text = “ “ Text2.text = “ “ End Sub

Private Sub cmdreset_click() Call clearcontrols() End Sub

General Procedure

Event Procedure 4