Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What does the following code mean "(Optional NoPrompt As Boolean = False)" in
this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in the brackets are the arguments for the sub
NoPrompt is a named variable for passing an argument Optional means it is not required =False means that if no argument is stated the default value is false savenewjob = SaveNewJob false without loooking at code no telling what NoPrompt does - in well written code it might mean that the sub will sve without prompting the user ? "Oldjay" wrote: What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It means that the macro tests a variable NoPrompt. The macro will assume it
is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't find where the varable NoPrompt is defined. I have searched the whole
project. I have found If NoPrompt Then JobNumber = "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave Else JobNumber = InputBox("Please enter JOB file name to save", "The d Company", "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave) End If "Bob Phillips" wrote: It means that the macro tests a variable NoPrompt. The macro will assume it is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is it,
If NoPrompt Then is the same as If NoPrompt = True Then -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... I can't find where the varable NoPrompt is defined. I have searched the whole project. I have found If NoPrompt Then JobNumber = "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave Else JobNumber = InputBox("Please enter JOB file name to save", "The d Company", "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave) End If "Bob Phillips" wrote: It means that the macro tests a variable NoPrompt. The macro will assume it is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a function, so NoPrompt is a placeholder. Any Boolean variable or
boolean constant may be passed to the function - the variable does not have to be call NoPrompt. Also, since the variable is shown as an optional argument, the calling functions are not required to pass any variable. -- Regards, Tom Ogilvy "Oldjay" wrote in message ... I can't find where the varable NoPrompt is defined. I have searched the whole project. I have found If NoPrompt Then JobNumber = "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave Else JobNumber = InputBox("Please enter JOB file name to save", "The d Company", "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave) End If "Bob Phillips" wrote: It means that the macro tests a variable NoPrompt. The macro will assume it is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My problem is what changes NoPrompt to true.
I can't find any referenceto it except the If- Then - Else "Tom Ogilvy" wrote: This is a function, so NoPrompt is a placeholder. Any Boolean variable or boolean constant may be passed to the function - the variable does not have to be call NoPrompt. Also, since the variable is shown as an optional argument, the calling functions are not required to pass any variable. -- Regards, Tom Ogilvy "Oldjay" wrote in message ... I can't find where the varable NoPrompt is defined. I have searched the whole project. I have found If NoPrompt Then JobNumber = "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave Else JobNumber = InputBox("Please enter JOB file name to save", "The d Company", "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave) End If "Bob Phillips" wrote: It means that the macro tests a variable NoPrompt. The macro will assume it is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oldjay,
You have find where this Sub is called from, where presumably you will find: SaveNewJob True or Call SaveNewJob(True) NickHK "Oldjay" wrote in message ... My problem is what changes NoPrompt to true. I can't find any referenceto it except the If- Then - Else "Tom Ogilvy" wrote: This is a function, so NoPrompt is a placeholder. Any Boolean variable or boolean constant may be passed to the function - the variable does not have to be call NoPrompt. Also, since the variable is shown as an optional argument, the calling functions are not required to pass any variable. -- Regards, Tom Ogilvy "Oldjay" wrote in message ... I can't find where the varable NoPrompt is defined. I have searched the whole project. I have found If NoPrompt Then JobNumber = "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave Else JobNumber = InputBox("Please enter JOB file name to save", "The d Company", "\\SERVER3\Jobs\Estimate1\NEW_JOBS1\" & Numbersave) End If "Bob Phillips" wrote: It means that the macro tests a variable NoPrompt. The macro will assume it is set to False, but when calling the macro, you can pass a value of True to force a different action. -- HTH RP (remove nothere from the email address if mailing direct) "Oldjay" wrote in message ... What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It means that the parameter called NoPrompt is optional - it can be left
blank if desired. If the value is supplied by the calling procedure, e.g. SaveNewJob(True), then the value of NoPrompt will be as specified at the time of the call. If it is not specified, e.g. SaveNewJob, then the sub will use the default value of False (the "= False" at the end of the parameter specification is telling it what the default value for NoPrompt is if it is not specified by the calling procedure) -- - K Dales "Oldjay" wrote: What does the following code mean "(Optional NoPrompt As Boolean = False)" in this line of code? Sub SaveNewJob(Optional NoPrompt As Boolean = False) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|