Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #440 > unrolled thread

Newbie question about nested subroutines

Started by"Dimmer" <Dimmer@Best.com>
First post2011-10-07 05:48 +1100
Last post2011-10-07 14:30 -0500
Articles 20 on this page of 23 — 6 participants

Back to article view | Back to comp.lang.basic.visual.misc


Contents

  Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 05:48 +1100
    Re: Newbie question about nested subroutines "Bob Butler" <bob_butler@cox.invalid> - 2011-10-06 13:54 -0700
      Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 10:39 +1100
        Re: Newbie question about nested subroutines "Bob Butler" <bob_butler@cox.invalid> - 2011-10-06 16:54 -0700
          Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 11:34 +1100
    Re: Newbie question about nested subroutines "Access Developer" <accdevel@gmail.com> - 2011-10-06 16:05 -0500
      Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 10:41 +1100
        Re: Newbie question about nested subroutines "Access Developer" <accdevel@gmail.com> - 2011-10-06 22:49 -0500
    Re: Newbie question about nested subroutines "Thorsten Albers" <gudea@gmx.de> - 2011-10-06 23:16 +0000
      Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 11:36 +1100
        Re: Newbie question about nested subroutines ralph <nt_consulting64@yahoo.net> - 2011-10-06 23:58 -0500
          MZ Tools "Dimmer" <Dimmer@Best.com> - 2011-10-08 19:37 +1100
            Re: MZ Tools ralph <nt_consulting64@yahoo.net> - 2011-10-08 10:53 -0500
      Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 12:15 +1100
      Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-07 12:32 +1100
        Re: Newbie question about nested subroutines "Bob Butler" <bob_butler@cox.invalid> - 2011-10-06 19:28 -0700
          Re: Newbie question about nested subroutines Deanna Earley <dee.earley@icode.co.uk> - 2011-10-07 09:17 +0100
            Re: Newbie question about nested subroutines ralph <nt_consulting64@yahoo.net> - 2011-10-07 10:26 -0500
              Re: Newbie question about nested subroutines Deanna Earley <dee.earley@icode.co.uk> - 2011-10-07 17:34 +0100
                Re: Newbie question about nested subroutines Deanna Earley <dee.earley@icode.co.uk> - 2011-10-07 17:37 +0100
                Re: Newbie question about nested subroutines ralph <nt_consulting64@yahoo.net> - 2011-10-07 12:04 -0500
              Re: Newbie question about nested subroutines "Dimmer" <Dimmer@Best.com> - 2011-10-08 05:32 +1100
                Re: Newbie question about nested subroutines ralph <nt_consulting64@yahoo.net> - 2011-10-07 14:30 -0500

Page 1 of 2  [1] 2  Next page →


#440 — Newbie question about nested subroutines

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 05:48 +1100
SubjectNewbie question about nested subroutines
Message-ID<4e8df7f8$1@dnews.tpgi.com.au>
Hi all

I am trying to arrange to access this sub a number of times in a program.

The sub works fine in intercepting ESC and certain other keystrokes.

I want to somehow arrange to repeatedly use it and this instictively 
suggests that it should be in a subroutine. But it is already in one!  Is 
there such a thing as nested subroutines? I want to call it and pass to it 
the particular Textboxes and Label concerned.  I emphasise that it works 
fine but I just don't want to have to have it appearing 13 times in a 13 
field form I have designed.

Any ideas?

Private Sub Text8_KeyPress(KeyAscii As Integer)
    Label23.Caption = "" '*** this label is used elsewhere for warning 
messages against that (8 in this case) text field
    If KeyAscii = 27 Then '*** ESC to blank and step back
        Text8.Text = ""
        Text7.SetFocus
    ElseIf KeyAscii <> 8 Then '***overtype
        Text8.SelLength = 1
    End If
    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine (Alib 
is Alan library!) I have developed that treats ENTER and TAB the same. It 
works fine
End Sub


The above all works fine. It's just that I want to avoid typing it all out 
again and again with different values for the LabelNo, TextNo, and 
PriorTextNo. 

[toc] | [next] | [standalone]


#441

From"Bob Butler" <bob_butler@cox.invalid>
Date2011-10-06 13:54 -0700
Message-ID<j6l4kq$pth$1@dont-email.me>
In reply to#440
"Dimmer" <Dimmer@Best.com> wrote in message 
news:4e8df7f8$1@dnews.tpgi.com.au...
> Hi all
>
> I am trying to arrange to access this sub a number of times in a program.
>
> The sub works fine in intercepting ESC and certain other keystrokes.
>
> I want to somehow arrange to repeatedly use it and this instictively 
> suggests that it should be in a subroutine. But it is already in one!  Is 
> there such a thing as nested subroutines? I want to call it and pass to it 
> the particular Textboxes and Label concerned.  I emphasise that it works 
> fine but I just don't want to have to have it appearing 13 times in a 13 
> field form I have designed.
>
> Any ideas?
>
> Private Sub Text8_KeyPress(KeyAscii As Integer)
>    Label23.Caption = "" '*** this label is used elsewhere for warning 
> messages against that (8 in this case) text field
>    If KeyAscii = 27 Then '*** ESC to blank and step back
>        Text8.Text = ""
>        Text7.SetFocus
>    ElseIf KeyAscii <> 8 Then '***overtype
>        Text8.SelLength = 1
>    End If
>    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine (Alib 
> is Alan library!) I have developed that treats ENTER and TAB the same. It 
> works fine
> End Sub

First, do yourself a huge favor and rename your controls.  "Text8" and 
"Label23" will mean nothing when you look at the code 6 months from now.

Second, try something lie this:

 Private Sub Text8_KeyPress(KeyAscii As Integer)
 ProcessDelandEsc KeyAscii, Text7, Text8, Label23
 End Sub

 Private Sub ProcessDelandEsc(KeyAscii As Integer, _
      ByVal TBack As TextBox, ByVal TCheck As TextBox, _
      ByVal LWarn As Label)
 LWarn.Caption = ""
 If KeyAscii = 27 Then '*** ESC to blank and step back
   TCheck.Text = ""
   TBack.SetFocus
 ElseIf KeyAscii <> 8 Then '***overtype
   TCheck.SelLength = 1
 End If
 Call AlibModule.EnterTabKey(KeyAscii)
 End Sub

[toc] | [prev] | [next] | [standalone]


#444

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 10:39 +1100
Message-ID<4e8e3c39@dnews.tpgi.com.au>
In reply to#441
Thanks Bob. Looks like you have solved my problem with Process (a keyword I 
was unfamiliar with) and By Val (an asepct that I am only just coming to 
terms with.

I totally agree with you about giving Text boxes and Labels meaningful names 
and I do in most of my projects. With this one, I have printed images of the 
form and marked the text boxes and labels with their numeric (default) 
names, precisely for the reason you say.

I'll try this later and let you know how I go.

Thanks again. A concise solution that I understand.

"Bob Butler" <bob_butler@cox.invalid> wrote in message 
news:j6l4kq$pth$1@dont-email.me...
>
> "Dimmer" <Dimmer@Best.com> wrote in message 
> news:4e8df7f8$1@dnews.tpgi.com.au...
>> Hi all
>>
>> I am trying to arrange to access this sub a number of times in a program.
>>
>> The sub works fine in intercepting ESC and certain other keystrokes.
>>
>> I want to somehow arrange to repeatedly use it and this instictively 
>> suggests that it should be in a subroutine. But it is already in one!  Is 
>> there such a thing as nested subroutines? I want to call it and pass to 
>> it the particular Textboxes and Label concerned.  I emphasise that it 
>> works fine but I just don't want to have to have it appearing 13 times in 
>> a 13 field form I have designed.
>>
>> Any ideas?
>>
>> Private Sub Text8_KeyPress(KeyAscii As Integer)
>>    Label23.Caption = "" '*** this label is used elsewhere for warning 
>> messages against that (8 in this case) text field
>>    If KeyAscii = 27 Then '*** ESC to blank and step back
>>        Text8.Text = ""
>>        Text7.SetFocus
>>    ElseIf KeyAscii <> 8 Then '***overtype
>>        Text8.SelLength = 1
>>    End If
>>    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine 
>> (Alib is Alan library!) I have developed that treats ENTER and TAB the 
>> same. It works fine
>> End Sub
>
> First, do yourself a huge favor and rename your controls.  "Text8" and 
> "Label23" will mean nothing when you look at the code 6 months from now.
>
> Second, try something lie this:
>
> Private Sub Text8_KeyPress(KeyAscii As Integer)
> ProcessDelandEsc KeyAscii, Text7, Text8, Label23
> End Sub
>
> Private Sub ProcessDelandEsc(KeyAscii As Integer, _
>      ByVal TBack As TextBox, ByVal TCheck As TextBox, _
>      ByVal LWarn As Label)
> LWarn.Caption = ""
> If KeyAscii = 27 Then '*** ESC to blank and step back
>   TCheck.Text = ""
>   TBack.SetFocus
> ElseIf KeyAscii <> 8 Then '***overtype
>   TCheck.SelLength = 1
> End If
> Call AlibModule.EnterTabKey(KeyAscii)
> End Sub
>
> 

[toc] | [prev] | [next] | [standalone]


#446

From"Bob Butler" <bob_butler@cox.invalid>
Date2011-10-06 16:54 -0700
Message-ID<j6lf68$sp4$1@dont-email.me>
In reply to#444
"Dimmer" <Dimmer@Best.com> wrote in message 
news:4e8e3c39@dnews.tpgi.com.au...
> Thanks Bob. Looks like you have solved my problem with Process (a keyword 
> I was unfamiliar with)

'Process' is not a keyword; I just created a sub and named it 
"ProcessDelAndESC" so that loking at the calling code I would have some idea 
what it does.  You can name it anything you like within the rules for 
procedure and variable names.

Thorsten is right that a control array might also work for you; it depends 
on what else you are doing with the controls.  The more they have in common 
the easier a conrol array would make things.

> and By Val (an asepct that I am only just coming to terms with.

'byval' and 'byref' are important to understand; I typically use ByVal out 
of habit unless I need ByRef or performance is critical.  Either would work 
here and a case can be made that ByRef would be more efficient.

> I totally agree with you about giving Text boxes and Labels meaningful 
> names and I do in most of my projects. With this one, I have printed 
> images of the form and marked the text boxes and labels with their numeric 
> (default) names, precisely for the reason you say.

That's fine until you can't find the printed image

[toc] | [prev] | [next] | [standalone]


#447

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 11:34 +1100
Message-ID<4e8e4913$1@dnews.tpgi.com.au>
In reply to#446
Thanks Bob for this further elucidation!

"Bob Butler" <bob_butler@cox.invalid> wrote in message 
news:j6lf68$sp4$1@dont-email.me...
>
> "Dimmer" <Dimmer@Best.com> wrote in message 
> news:4e8e3c39@dnews.tpgi.com.au...
>> Thanks Bob. Looks like you have solved my problem with Process (a keyword 
>> I was unfamiliar with)
>
> 'Process' is not a keyword; I just created a sub and named it 
> "ProcessDelAndESC" so that loking at the calling code I would have some 
> idea

Oh, I see. I was just going to look up the syntax for 'Process'!

> what it does.  You can name it anything you like within the rules for 
> procedure and variable names.
>
> Thorsten is right that a control array might also work for you; it depends 
> on what else you are doing with the controls.  The more they have in 
> common the easier a conrol array would make things.
>
>> and By Val (an asepct that I am only just coming to terms with.
>
> 'byval' and 'byref' are important to understand; I typically use ByVal out 
> of habit unless I need ByRef or performance is critical.  Either would 
> work here and a case can be made that ByRef would be more efficient.

(OK, got it)

>> I totally agree with you about giving Text boxes and Labels meaningful 
>> names and I do in most of my projects. With this one, I have printed 
>> images of the form and marked the text boxes and labels with their 
>> numeric (default) names, precisely for the reason you say.
>
> That's fine until you can't find the printed image

What, with my super duper filing system!  Impossible!  Now, where on Earth 
is my list of things to remember?.. On it I'm sure I have a note of where it 
is?

[toc] | [prev] | [next] | [standalone]


#442

From"Access Developer" <accdevel@gmail.com>
Date2011-10-06 16:05 -0500
Message-ID<9f6jh3FpdsU1@mid.individual.net>
In reply to#440
Either I don't understand what you want to do, or (and I suspect this is the 
case) you don't understand programming with VBA.

You can either put that Sub Procedure in the general section of the Form's 
module or in a separate standard Module with a Control object and Label 
object as arguments, and call it from an event of the textbox, passing the 
textbox and label. If you put it in a standard module, you can call if from 
code in multiple Forms' modules.

-- 
 Larry Linson, Microsoft Office Access MVP
 Co-author: "Microsoft Access Small Business Solutions", published by Wiley
 Access newsgroup support is alive and well in USENET 
comp.databases.ms-access

"Dimmer" <Dimmer@Best.com> wrote in message 
news:4e8df7f8$1@dnews.tpgi.com.au...
> Hi all
>
> I am trying to arrange to access this sub a number of times in a program.
>
> The sub works fine in intercepting ESC and certain other keystrokes.
>
> I want to somehow arrange to repeatedly use it and this instictively 
> suggests that it should be in a subroutine. But it is already in one!  Is 
> there such a thing as nested subroutines? I want to call it and pass to it 
> the particular Textboxes and Label concerned.  I emphasise that it works 
> fine but I just don't want to have to have it appearing 13 times in a 13 
> field form I have designed.
>
> Any ideas?
>
> Private Sub Text8_KeyPress(KeyAscii As Integer)
>    Label23.Caption = "" '*** this label is used elsewhere for warning 
> messages against that (8 in this case) text field
>    If KeyAscii = 27 Then '*** ESC to blank and step back
>        Text8.Text = ""
>        Text7.SetFocus
>    ElseIf KeyAscii <> 8 Then '***overtype
>        Text8.SelLength = 1
>    End If
>    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine (Alib 
> is Alan library!) I have developed that treats ENTER and TAB the same. It 
> works fine
> End Sub
>
>
> The above all works fine. It's just that I want to avoid typing it all out 
> again and again with different values for the LabelNo, TextNo, and 
> PriorTextNo.
> 

[toc] | [prev] | [next] | [standalone]


#445

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 10:41 +1100
Message-ID<4e8e3cba@dnews.tpgi.com.au>
In reply to#442
Many thanks, but this is not VBA; it is VB6. I have been given the answer by 
Bob (lloks like you are explaining much the same thing, but it is too 
abstract for this newbie!. Bob has answered me in terms I can understand.

Thanks again for responding.

"Access Developer" <accdevel@gmail.com> wrote in message 
news:9f6jh3FpdsU1@mid.individual.net...
> Either I don't understand what you want to do, or (and I suspect this is 
> the case) you don't understand programming with VBA.
>
> You can either put that Sub Procedure in the general section of the Form's 
> module or in a separate standard Module with a Control object and Label 
> object as arguments, and call it from an event of the textbox, passing the 
> textbox and label. If you put it in a standard module, you can call if 
> from code in multiple Forms' modules.
>
> -- 
> Larry Linson, Microsoft Office Access MVP
> Co-author: "Microsoft Access Small Business Solutions", published by Wiley
> Access newsgroup support is alive and well in USENET 
> comp.databases.ms-access
>
> "Dimmer" <Dimmer@Best.com> wrote in message 
> news:4e8df7f8$1@dnews.tpgi.com.au...
>> Hi all
>>
>> I am trying to arrange to access this sub a number of times in a program.
>>
>> The sub works fine in intercepting ESC and certain other keystrokes.
>>
>> I want to somehow arrange to repeatedly use it and this instictively 
>> suggests that it should be in a subroutine. But it is already in one!  Is 
>> there such a thing as nested subroutines? I want to call it and pass to 
>> it the particular Textboxes and Label concerned.  I emphasise that it 
>> works fine but I just don't want to have to have it appearing 13 times in 
>> a 13 field form I have designed.
>>
>> Any ideas?
>>
>> Private Sub Text8_KeyPress(KeyAscii As Integer)
>>    Label23.Caption = "" '*** this label is used elsewhere for warning 
>> messages against that (8 in this case) text field
>>    If KeyAscii = 27 Then '*** ESC to blank and step back
>>        Text8.Text = ""
>>        Text7.SetFocus
>>    ElseIf KeyAscii <> 8 Then '***overtype
>>        Text8.SelLength = 1
>>    End If
>>    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine 
>> (Alib is Alan library!) I have developed that treats ENTER and TAB the 
>> same. It works fine
>> End Sub
>>
>>
>> The above all works fine. It's just that I want to avoid typing it all 
>> out again and again with different values for the LabelNo, TextNo, and 
>> PriorTextNo.
>>
>
> 

[toc] | [prev] | [next] | [standalone]


#452

From"Access Developer" <accdevel@gmail.com>
Date2011-10-06 22:49 -0500
Message-ID<9f7b65F4bbU1@mid.individual.net>
In reply to#445
Yes, my mistyping.  Glad it's "under control now".  And, yes, VBA is nearly 
identical to VB6 code, but the environment in which it runs (MS Office and 
other apps) is different.

-- 
 Larry Linson, Microsoft Office Access MVP
 Co-author: "Microsoft Access Small Business Solutions", published by Wiley
 Access newsgroup support is alive and well in USENET 
comp.databases.ms-access

"Dimmer" <Dimmer@Best.com> wrote in message 
news:4e8e3cba@dnews.tpgi.com.au...
> Many thanks, but this is not VBA; it is VB6. I have been given the answer 
> by Bob (lloks like you are explaining much the same thing, but it is too 
> abstract for this newbie!. Bob has answered me in terms I can understand.
>
> Thanks again for responding.
>
> "Access Developer" <accdevel@gmail.com> wrote in message 
> news:9f6jh3FpdsU1@mid.individual.net...
>> Either I don't understand what you want to do, or (and I suspect this is 
>> the case) you don't understand programming with VBA.
>>
>> You can either put that Sub Procedure in the general section of the 
>> Form's module or in a separate standard Module with a Control object and 
>> Label object as arguments, and call it from an event of the textbox, 
>> passing the textbox and label. If you put it in a standard module, you 
>> can call if from code in multiple Forms' modules.
>>
>> -- 
>> Larry Linson, Microsoft Office Access MVP
>> Co-author: "Microsoft Access Small Business Solutions", published by 
>> Wiley
>> Access newsgroup support is alive and well in USENET 
>> comp.databases.ms-access
>>
>> "Dimmer" <Dimmer@Best.com> wrote in message 
>> news:4e8df7f8$1@dnews.tpgi.com.au...
>>> Hi all
>>>
>>> I am trying to arrange to access this sub a number of times in a 
>>> program.
>>>
>>> The sub works fine in intercepting ESC and certain other keystrokes.
>>>
>>> I want to somehow arrange to repeatedly use it and this instictively 
>>> suggests that it should be in a subroutine. But it is already in one! 
>>> Is there such a thing as nested subroutines? I want to call it and pass 
>>> to it the particular Textboxes and Label concerned.  I emphasise that it 
>>> works fine but I just don't want to have to have it appearing 13 times 
>>> in a 13 field form I have designed.
>>>
>>> Any ideas?
>>>
>>> Private Sub Text8_KeyPress(KeyAscii As Integer)
>>>    Label23.Caption = "" '*** this label is used elsewhere for warning 
>>> messages against that (8 in this case) text field
>>>    If KeyAscii = 27 Then '*** ESC to blank and step back
>>>        Text8.Text = ""
>>>        Text7.SetFocus
>>>    ElseIf KeyAscii <> 8 Then '***overtype
>>>        Text8.SelLength = 1
>>>    End If
>>>    Call AlibModule.EnterTabKey(KeyAscii) 'this is a standard routine 
>>> (Alib is Alan library!) I have developed that treats ENTER and TAB the 
>>> same. It works fine
>>> End Sub
>>>
>>>
>>> The above all works fine. It's just that I want to avoid typing it all 
>>> out again and again with different values for the LabelNo, TextNo, and 
>>> PriorTextNo.
>>>
>>
>>
>
> 

[toc] | [prev] | [next] | [standalone]


#443

From"Thorsten Albers" <gudea@gmx.de>
Date2011-10-06 23:16 +0000
Message-ID<01cc847e$07167600$6d01a8c0@k8s8x>
In reply to#440
Dimmer <Dimmer@Best.com> schrieb im Beitrag
<4e8df7f8$1@dnews.tpgi.com.au>...
> The above all works fine. It's just that I want to avoid typing it all
out 
> again and again with different values for the LabelNo, TextNo, and 
> PriorTextNo. 

Either use the code of Bob or use control arrays. A control array is an
array of controls of the same control type in which all controls have the
same name but a different index number. To create a control array put the
control on a form and set its index property (usually to 0). With a control
array you have only _one_ event procedure for all controls of the array.

-- 
Thorsten Albers

gudea  at  gmx.de

[toc] | [prev] | [next] | [standalone]


#448

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 11:36 +1100
Message-ID<4e8e4980@dnews.tpgi.com.au>
In reply to#443
"Thorsten Albers" <gudea@gmx.de> wrote in message 
news:01cc847e$07167600$6d01a8c0@k8s8x...
> Dimmer <Dimmer@Best.com> schrieb im Beitrag
> <4e8df7f8$1@dnews.tpgi.com.au>...
>> The above all works fine. It's just that I want to avoid typing it all
> out
>> again and again with different values for the LabelNo, TextNo, and
>> PriorTextNo.
>
> Either use the code of Bob or use control arrays. A control array is an
> array of controls of the same control type in which all controls have the
> same name but a different index number. To create a control array put the
> control on a form and set its index property (usually to 0). With a 
> control
> array you have only _one_ event procedure for all controls of the array.
>
> -- 
> Thorsten Albers
>
Right. Got that.  That actually did occur to me, but because I am developing 
the form on the fly, the arrany elemnts would get out of order, so I've not 
done that when invited in the IDE!  Thanks for this further point. 

[toc] | [prev] | [next] | [standalone]


#453

Fromralph <nt_consulting64@yahoo.net>
Date2011-10-06 23:58 -0500
Message-ID<2avs87tbk4plm1re5atje6euftqmucai50@4ax.com>
In reply to#448
On Fri, 7 Oct 2011 11:36:07 +1100, "Dimmer" <Dimmer@Best.com> wrote:

>
>"Thorsten Albers" <gudea@gmx.de> wrote in message 
>news:01cc847e$07167600$6d01a8c0@k8s8x...
>> Dimmer <Dimmer@Best.com> schrieb im Beitrag
>> <4e8df7f8$1@dnews.tpgi.com.au>...
>>> The above all works fine. It's just that I want to avoid typing it all
>> out
>>> again and again with different values for the LabelNo, TextNo, and
>>> PriorTextNo.
>>
>> Either use the code of Bob or use control arrays. A control array is an
>> array of controls of the same control type in which all controls have the
>> same name but a different index number. To create a control array put the
>> control on a form and set its index property (usually to 0). With a 
>> control
>> array you have only _one_ event procedure for all controls of the array.
>>
>> -- 
>> Thorsten Albers
>>
>Right. Got that.  That actually did occur to me, but because I am developing 
>the form on the fly, the arrany elemnts would get out of order, so I've not 
>done that when invited in the IDE!  Thanks for this further point. 
>

It is not necessary to be concerned the array elements "would get out
of order" for a Control Array. (Unlike, say a TabIndex.) To attach a
'name' for each specific control create an Enum at the top of your
Form source.

[Public | Private] Enum TextBoxEnum
  eText1
  eTextPictFour
  eTextIn
  eTextOut
End Enum 
#If 0 Then     ' include the following to preserve case
     Private eText1, eTextPictFour, eTextIn, eTextOut
#End If

You can then go back and change 'order' or rename by simply editing
the Enum and doing a quick find and replace.

But it sounds like your real problem is the extra clicking and typing
in the beginning when you first add a control. You need to check out
MZTools at 
http://www.mztools.com/v3/mztools3.aspx
[Price is right - Free.]

One of its many features is one where each time you add a control to a
form you are asked for the Name of the new control. MZTools will make
providing unique names and subsequent renaming of those controls very
convenient.
http://www.mztools.com/v3/features.aspx

I consider the MZTools Addon an absolute requirement for any VB
development.

-ralph

[toc] | [prev] | [next] | [standalone]


#461 — MZ Tools

From"Dimmer" <Dimmer@Best.com>
Date2011-10-08 19:37 +1100
SubjectMZ Tools
Message-ID<4e900bed@dnews.tpgi.com.au>
In reply to#453
"ralph" <nt_consulting64@yahoo.net> wrote in message 
news:2avs87tbk4plm1re5atje6euftqmucai50@4ax.com...
You need to check out
> MZTools at
> http://www.mztools.com/v3/mztools3.aspx
> [Price is right - Free.]
>
> One of its many features is one where each time you add a control to a
> form you are asked for the Name of the new control. MZTools will make
> providing unique names and subsequent renaming of those controls very
> convenient.
> http://www.mztools.com/v3/features.aspx
>
> I consider the MZTools Addon an absolute requirement for any VB
> development.
>
> -ralph

Ralph, is there a foolproof procedure for *un*installing MZTools if I don't 
like it. I just love the IDE as it is.

I am horrified by the comparative crudeness of Java, which I've had a look 
at thinking it would be step forward. 

[toc] | [prev] | [next] | [standalone]


#462 — Re: MZ Tools

Fromralph <nt_consulting64@yahoo.net>
Date2011-10-08 10:53 -0500
SubjectRe: MZ Tools
Message-ID<vdr097tu4age5h4gtjo0pho4nsbgn4a139@4ax.com>
In reply to#461
On Sat, 8 Oct 2011 19:37:55 +1100, "Dimmer" <Dimmer@Best.com> wrote:

>
>"ralph" <nt_consulting64@yahoo.net> wrote in message 
>news:2avs87tbk4plm1re5atje6euftqmucai50@4ax.com...
>You need to check out
>> MZTools at
>> http://www.mztools.com/v3/mztools3.aspx
>> [Price is right - Free.]
>>
>> One of its many features is one where each time you add a control to a
>> form you are asked for the Name of the new control. MZTools will make
>> providing unique names and subsequent renaming of those controls very
>> convenient.
>> http://www.mztools.com/v3/features.aspx
>>
>> I consider the MZTools Addon an absolute requirement for any VB
>> development.
>>
>> -ralph
>
>Ralph, is there a foolproof procedure for *un*installing MZTools if I don't 
>like it. I just love the IDE as it is.
>

Yes. From the VBIDE main menu go to Add Ons->Add On Manager and select
one of the unload options.

Installing MZTools does nothing magical or complex. It consists of one
DLL and a few Registry Entries. To completely remove MZTools you can
run the MZTools uninstaller or manually delete the DLL and Registery
Entries.

MZTools merely adds features MS forgot. You will love it.

-ralph

[toc] | [prev] | [next] | [standalone]


#449

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 12:15 +1100
Message-ID<4e8e52a6$1@dnews.tpgi.com.au>
In reply to#443
Hi again Bob

Looking at my code, I originally got most of it exactly as you have just 
shown me but without the ByVal.

It now works fine (once I had realised that there's no space between By and 
Val!)  A great introduction to this concept.

Many thanks again. You approach in showing a practical snippet is just right 
for me.

[toc] | [prev] | [next] | [standalone]


#450

From"Dimmer" <Dimmer@Best.com>
Date2011-10-07 12:32 +1100
Message-ID<4e8e56c9$1@dnews.tpgi.com.au>
In reply to#443
Also Bob, I have found out that if I use the word CALL it is OK as long as 
the arguments are in brackets. Without CALL as in your example also works 
but then brackets must not be used. I imagine that the two syntaxes are 
optional? 

[toc] | [prev] | [next] | [standalone]


#451

From"Bob Butler" <bob_butler@cox.invalid>
Date2011-10-06 19:28 -0700
Message-ID<j6lo80$9t0$1@dont-email.me>
In reply to#450
"Dimmer" <Dimmer@Best.com> wrote in message 
news:4e8e56c9$1@dnews.tpgi.com.au...
> Also Bob, I have found out that if I use the word CALL it is OK as long as 
> the arguments are in brackets. Without CALL as in your example also works 
> but then brackets must not be used. I imagine that the two syntaxes are 
> optional?

Correct

Call procedurename(argumentlist)
-or-
procedurename argumentlist

[toc] | [prev] | [next] | [standalone]


#454

FromDeanna Earley <dee.earley@icode.co.uk>
Date2011-10-07 09:17 +0100
Message-ID<j6mci3$qdf$1@speranza.aioe.org>
In reply to#451
On 07/10/2011 03:28, Bob Butler wrote:
>
> "Dimmer" <Dimmer@Best.com> wrote in message
> news:4e8e56c9$1@dnews.tpgi.com.au...
>> Also Bob, I have found out that if I use the word CALL it is OK as
>> long as the arguments are in brackets. Without CALL as in your example
>> also works but then brackets must not be used. I imagine that the two
>> syntaxes are optional?
>
> Correct
>
> Call procedurename(argumentlist)
> -or-
> procedurename argumentlist

And just a warning that while mixing them is syntactically valid for one 
parameter, it does NOT always do what you expect and will catch you out 
with a bug at some point:
procedurename (argument)

It evaluates 'argument', which for objects, gets the default property, 
and other types, converts to a variant with an implicit byval.

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

[toc] | [prev] | [next] | [standalone]


#455

Fromralph <nt_consulting64@yahoo.net>
Date2011-10-07 10:26 -0500
Message-ID<te5u8790j2qgugvss4tnu11ffiv0oiis6j@4ax.com>
In reply to#454
On Fri, 07 Oct 2011 09:17:09 +0100, Deanna Earley
<dee.earley@icode.co.uk> wrote:

>On 07/10/2011 03:28, Bob Butler wrote:
>>
>> "Dimmer" <Dimmer@Best.com> wrote in message
>> news:4e8e56c9$1@dnews.tpgi.com.au...
>>> Also Bob, I have found out that if I use the word CALL it is OK as
>>> long as the arguments are in brackets. Without CALL as in your example
>>> also works but then brackets must not be used. I imagine that the two
>>> syntaxes are optional?
>>
>> Correct
>>
>> Call procedurename(argumentlist)
>> -or-
>> procedurename argumentlist
>
>And just a warning that while mixing them is syntactically valid for one 
>parameter, it does NOT always do what you expect and will catch you out 
>with a bug at some point:
>procedurename (argument)
>
>It evaluates 'argument', which for objects, gets the default property, 
>and other types, converts to a variant with an implicit byval.

Always a good warning.

    Procedurename argument
is not semantically the same as
    Procedurename (argument)

However, I disagree with the characterization that it is a 'bug' or
that the results should even be 'unexpected'. The grammatic rules for
calling VB procedures and using parathentheses are very clear. If one
doesn't follow the rules then surprises are to be expected. <g>

-ralph

[toc] | [prev] | [next] | [standalone]


#456

FromDeanna Earley <dee.earley@icode.co.uk>
Date2011-10-07 17:34 +0100
Message-ID<j6n9ms$7c8$1@speranza.aioe.org>
In reply to#455
On 07/10/2011 16:26, ralph wrote:
>      Procedurename argument
> is not semantically the same as
>      Procedurename (argument)
>
> However, I disagree with the characterization that it is a 'bug' or
> that the results should even be 'unexpected'. The grammatic rules for
> calling VB procedures and using parathentheses are very clear. If one
> doesn't follow the rules then surprises are to be expected.<g>

Of course, but I expect people to not read/know the rules and so will 
not be expecting defined behaviour :p
That and the amount of people I've had to tell this to when they were 
bitten by it...

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

[toc] | [prev] | [next] | [standalone]


#457

FromDeanna Earley <dee.earley@icode.co.uk>
Date2011-10-07 17:37 +0100
Message-ID<j6n9rd$7c8$2@speranza.aioe.org>
In reply to#456
On 07/10/2011 17:34, Deanna Earley wrote:
> On 07/10/2011 16:26, ralph wrote:
>> Procedurename argument
>> is not semantically the same as
>> Procedurename (argument)
>>
>> However, I disagree with the characterization that it is a 'bug' or
>> that the results should even be 'unexpected'. The grammatic rules for
>> calling VB procedures and using parathentheses are very clear. If one
>> doesn't follow the rules then surprises are to be expected.<g>
>
> Of course, but I expect people to not read/know the rules and so will
> not be expecting defined behaviour :p
> That and the amount of people I've had to tell this to when they were
> bitten by it...

Oh, and by bug I meant a bug in people's code that has the () when it 
shouldn't, not a bug in the VB libs/parsing.

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.basic.visual.misc


csiph-web