Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Experiment - Passing arguments by name

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Sep 16th, 2014, 6:11pm    Post subject: Experiment - Passing arguments by name Reply with quote

The most recent release of VF adds the ability to pass arguments by explicitly providing the names of the parameters. You do this by typing the name enclosed inside square brackets ([]) and following it with the expression you are passing to the procedure. You may optionally separate the name and expression with an equals sign (=).

For example, given the following:
Code:
Sub Test arg1, Optional arg2, arg3
    ' whatever
End Sub

  • You can call it normally:
     Call Test 1, 2, 3
  • You can leave an argument empty:
     Call Test 1, , 3
  • You can give it explicit arguments:
     Call Test [arg1]1, [arg2]2, [arg3]3
  • You can re-arrange the arguments:
     Call Test [arg3]3, [arg2]2, [arg1]1
  • You can make a mixture:
     Call Test 1, [arg3]=3

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group