abap 子例程_Visual Basic:什么是子例程/子例程与函数之间的区别?

本文介绍了Visual Basic中的子例程(Subroutines)和函数(Functions),解释了它们的区别。子例程是执行特定任务的代码块,而函数除了执行任务外,还可以返回值。在编程中,方法是实现功能或逻辑的代码块,Visual Basic中的所有功能都封装在方法(子例程或函数)内。面向对象编程(OOP)是包括Visual Basic、Java和C++等语言在内的常用编程范式。
摘要由CSDN通过智能技术生成

abap 子例程

.NET framework

Subroutines are another word for methods, and they’re code blocks that will be executed by your application as you call them elsewhere in your applications. To call a subroutine, just call it by the subroutine’s name (for instance, if you created your own subroutines).

子例程是方法的另一种说法,它们是代码块,将在您在应用程序的其他地方调用它们时由您的应用程序执行。 要调用子例程,只需使用子例程的名称进行调用(例如,如果您创建了自己的子例程)。

The Public, Private and Protected keywords are incase you create multiple classes (explained below) and you want to choose whether other classes have access to use the respective methods (or subroutines) you have created. You can search online for the exact definition of these three keywords.

如果您创建多个类(如下所述),并且想要选择其他类是否有权使用您创建的相应方法(或子例程),则使用Public,Private和Protected关键字。 您可以在线搜索这三个关键字的确切定义。

Say you have a subroutine that does some task of some kind, you call it and the code within that subroutine gets executed. However, the thing is, what if you wanted to make sure some code in the subroutine did it’s job? What about using the Return keyword and return either true or false depending on whether the portions

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值