Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Getting Variables from a Sub


Message #1 by "Marcelo" <cyborg@m...> on Wed, 21 Feb 2001 09:49:10 -0300
I need to take some variable off a sub....I can pass values to it, but I

can't retrieve them.

The sub is the next:

Sub XXXX

  intEnd= instr (1,strRSIP,".")

  intRSIPA = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intEnd= instr (1,strRSIP,".")

  intRSIPB = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intEnd= instr (1,strRSIP,".")

  intRSIPC = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intRSIPD = strRSIP

End Sub



I passes strRSIP directly as a variable,  intRSIPA, B,C,D   doesn't came

after the sub ends...what's mi error?



Thanks



Marcelo





Message #2 by "Pham, Khanh" <Khanh.Pham@d...> on Wed, 21 Feb 2001 07:51:53 -0500
Sub cannot return a value.  Use Functions instead.



-----Original Message-----

From: Marcelo [mailto:cyborg@m...]

Sent: Wednesday, February 21, 2001 7:49 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Getting Variables from a Sub





I need to take some variable off a sub....I can pass values to it, but I

can't retrieve them.

The sub is the next:

Sub XXXX

  intEnd= instr (1,strRSIP,".")

  intRSIPA = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intEnd= instr (1,strRSIP,".")

  intRSIPB = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intEnd= instr (1,strRSIP,".")

  intRSIPC = left (strRSIP,intEnd-1)

  strRSIP = right (strRSIP,len(strRSIP)-intEnd)

  intRSIPD = strRSIP

End Sub



I passes strRSIP directly as a variable,  intRSIPA, B,C,D   doesn't came

after the sub ends...what's mi error?



Thanks



Marcelo



Message #3 by "Wally Burfine" <oopconsultant@h...> on Wed, 21 Feb 2001 18:35:27 -0000
either make the sub a function and pass back the return or define the 

variables as global



Regards,

Wally




  Return to Index