Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > TrueUpdate 2.0

 
 
Thread Tools Display Modes
  #1  
Old 10-31-2005
SeizeTheDave SeizeTheDave is offline
Forum Member
 
Join Date: Oct 2005
Posts: 5
Functions and default parameter values

Is there a way to assign a default value to a parameter in a function definition so that you do not have to enter a value for said parameter when actually calling the function?

Thanks
  #2  
Old 10-31-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
My understanding is that the variable name being passed is a "local" variable. That said, you should be able to do this:

Code:
function MyFunction(sFolder)
     if sFolder == nil then
          sFolder = "C:\\Program Files\\"
     end
     --whatever you need to do here
end
  #3  
Old 10-31-2005
SeizeTheDave SeizeTheDave is offline
Forum Member
 
Join Date: Oct 2005
Posts: 5
Worm,

Thanks for the reply. That seems to work. It's a little different than I'm used to, but it does the job. Thanks

Dave
  #4  
Old 10-31-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
NP, glad I could help.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
5.0 -- good enhancements, but lacking others dallasfreak2 AutoPlay Media Studio 5.0 6 11-02-2004 03:34 PM


All times are GMT -6. The time now is 02:38 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software