VB“呼叫”语法与命令式语法

编程入门 行业动态 更新时间:2024-10-26 04:30:42
本文介绍了VB“呼叫”语法与命令式语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找编码风格的意见。 在我看来,大多数VB / VBA编码器都使用命令式语法 在特定的上下文中调用subs或函数被视为subs ... Foo" ABC",varDest 偶尔,我看到代码使用Call语法代替。 调用Foo(ABC,varDest) 我曾经发现这很奇怪,但现在,我想知道它是不是真的是优质的风格。基本上,我发现自己开始使用命名参数 更多(无论什么参数必须通过 查看调用行,并不是很明显),以及我认为在这些情况下Call更容易阅读。所以, 确实是一致的,我想我可能会在所有情况下都开始使用Call。 Foo Src:=" ABC", Dest:= varDest vs Call Foo(Src:=" ABC",Dest:= varDest) 您的想法?

I''m looking for coding style opinions. It looks to me like most VB/VBA coders use the command-style syntax for calling subs or functions being treated as subs in a particular context ... Foo "ABC", varDest Occasionally, I see code using the Call syntax instead. Call Foo("ABC", varDest) I used to find that wierd, but now, I''m wondering if it isn''t really the superior style. Basically, I find myself starting to use named parameters more (whenever it isn''t blatantly obvious what the parameters must be by looking at the call line), and I think Call reads easier in these cases. So, do be consistent, I''m thinking I might just start using Call in all cases. Foo Src:="ABC", Dest:=varDest vs Call Foo(Src:="ABC", Dest:=varDest) Your thoughts?

推荐答案

" Steve Jorgensen" <无**** @ nospam.nospam>在消息中写道 news:j5 ******************************** @ 4ax ... "Steve Jorgensen" <no****@nospam.nospam> wrote in message news:j5********************************@4ax... 我正在寻找编码风格的意见。 在我看来,大多数VB / VBA编码器都使用命令式语法调用subs或函数在特定上下文中被视为subs $ $ $ $ .... Foo" ABC",varDest 偶尔,我会看到使用Call语法的代码。 打电话给Foo(ABC,varDest) 我曾经发现那很奇怪,但现在,我想知道它是不是真的<优越的风格。基本上,我发现自己开始更多地使用命名的参数(无论何时通过查看调用线并不明显显示参数必须是什么),我认为在这些情况下Call更容易阅读。 所以,要保持一致,我想我可能只是开始使用Call in all I''m looking for coding style opinions. It looks to me like most VB/VBA coders use the command-style syntax for calling subs or functions being treated as subs in a particular context .... Foo "ABC", varDest Occasionally, I see code using the Call syntax instead. Call Foo("ABC", varDest) I used to find that wierd, but now, I''m wondering if it isn''t really the superior style. Basically, I find myself starting to use named parameters more (whenever it isn''t blatantly obvious what the parameters must be by looking at the call line), and I think Call reads easier in these cases. So, do be consistent, I''m thinking I might just start using Call in all

的情况。 我总是使用Call。似乎更多的自我记录给我。 - 我没有查看附加的电子邮件帐户 到此消息。发送给... ... 在Hunter dot com的RBrandt

cases. I''ve always used Call. Seems more self-documenting to me. -- I don''t check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com

2004年7月30日星期五16:00:29 GMT,Steve Jorgensen < no **** @ nospam.nospam>写道: 一旦你在VB.NET中编写代码,你将不得不学习它 在VBA环境中,我发现打电话更类似于函数调用, 因此我喜欢它。 -Tom。 On Fri, 30 Jul 2004 16:00:29 GMT, Steve Jorgensen <no****@nospam.nospam> wrote: You''ll have to un-learn it once you write code in VB.NET In the VBA environment I find Call more similar to function calls, and I like it for that reason. -Tom. 我正在寻找编码风格的意见。 在我看来,大多数VB / VBA编码器都使用命令式语法来调用被视为sub或函数的子函数在一个特定的上下文中的子... Foo" ABC",varDest 偶尔,我会看到使用Call语法的代码。 打电话给Foo(ABC,varDest) 我曾经发现这很奇怪,但是现在,我想知道它是不是真的是优越的风格。基本上,我发现自己开始更多地使用命名参数(每当看到调用线时参数必须明显不明显时),我认为在这些情况下调用更容易。所以,确实是一致的,我想我可能会在所有情况下都开始使用Call。 Foo Src:=" ABC",Dest:= varDest vs 调用Foo(Src:=" ABC",Dest:= varDest) 你的想法? I''m looking for coding style opinions.It looks to me like most VB/VBA coders use the command-style syntax forcalling subs or functions being treated as subs in a particular context ... Foo "ABC", varDestOccasionally, I see code using the Call syntax instead. Call Foo("ABC", varDest)I used to find that wierd, but now, I''m wondering if it isn''t really thesuperior style. Basically, I find myself starting to use named parametersmore (whenever it isn''t blatantly obvious what the parameters must be bylooking at the call line), and I think Call reads easier in these cases. So,do be consistent, I''m thinking I might just start using Call in all cases. Foo Src:="ABC", Dest:=varDestvs Call Foo(Src:="ABC", Dest:=varDest) Your thoughts?

" Steve Jorgensen" <无**** @ nospam.nospam>在消息中写道 news:j5 ******************************** @ 4ax ... "Steve Jorgensen" <no****@nospam.nospam> wrote in message news:j5********************************@4ax... 我正在寻找编码风格的意见。 在我看来,大多数VB / VBA编码器都使用命令式语法调用subs或函数在特定上下文中被视为subs $ $ $ $ .... Foo" ABC",varDest 偶尔,我会看到使用Call语法的代码。 打电话给Foo(ABC,varDest) 我曾经发现那很奇怪,但现在,我想知道它是不是真的<优越的风格。基本上,我发现自己开始更多地使用命名参数(每当看到调用线时参数必须明显不明显时),我认为在这些情况下调用更容易。 所以,要保持一致,我想我可能会在所有情况下都开始使用Call。 Foo Src:=" ABC",Dest:= varDest vs 调用Foo(Src:=" ABC",Dest:= varDest) 您的想法? I''m looking for coding style opinions. It looks to me like most VB/VBA coders use the command-style syntax for calling subs or functions being treated as subs in a particular context .... Foo "ABC", varDest Occasionally, I see code using the Call syntax instead. Call Foo("ABC", varDest) I used to find that wierd, but now, I''m wondering if it isn''t really the superior style. Basically, I find myself starting to use named parameters more (whenever it isn''t blatantly obvious what the parameters must be by looking at the call line), and I think Call reads easier in these cases. So, do be consistent, I''m thinking I might just start using Call in all cases. Foo Src:="ABC", Dest:=varDest vs Call Foo(Src:="ABC", Dest:=varDest) Your thoughts?

打电话给foo种族主义者。我不是叫jorgensen真的吗? * Sherwood Wang MVP *

call foo racist. i not call jorgensen true? *Sherwood Wang MVP*

更多推荐

VB“呼叫”语法与命令式语法

本文发布于:2023-07-30 00:21:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1244934.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   命令   VB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!