Groups | Blog | Home
all groups > asp.net > july 2003 >

asp.net : Run sub procedure -- "expression expected" ???



Kathy Burke
7/31/2003 10:54:34 PM
Hi again,

I'm trying to run a sub from within another:

Public Sub txtScan_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
txtScan.TextChanged

ProcessSN(ByVal sender As System.Object, ByVal e As
System.EventArgs)

End Sub

ByVal is indicating "expression expected". What is the correct way to
run a sub from another?

Thanks.
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
KD
7/31/2003 11:45:27 PM
Hi Kathy!
The ProcessSN procedure seems to be an event handler of
some sort.
I would guess that it would be the solution for you to
move whatever code you have in that procedure to a
separate procedure. Then call the new procedure from both
the txtScan_TextChanged and ProcessN event handling
procedure.
Finally if you want to call another procedure you just
use the procedurename and send in the necessary datatypes.
Ex: "SomeProc(MyObject, strValue)" would be a correct way
to call "private SomeProc(ByVal SomeObj As Object, ByVal
SomeStr As String)"

[quoted text, click to view]
Kathy Burke
8/1/2003 12:03:23 AM
Thanks KD...that made it clearer. I'll go play with it.

thanks.

KathyBurke

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button