Click to See Complete Forum and Search --> : Small Webservice Query!!


benq
10-16-2006, 10:04 AM
hi all

just a quick help with this bit of code.

i did this small web service from the book and i commented could someone please have a look at the comment and see if i got the right idea.



<WebMethod()> Public Function helloworld_or_any_name_varaiable(ByVal my_varaiable As String) As String
'create a function by assinging a variable(sub string from the value ) show as string
helloworld_or_any_name_varaiable = "hi world, " & my_varaiable
'function= value of function = variable value assigned = hi world
End Function

End Class



thanks :blush:

sirpelidor
10-16-2006, 01:58 PM
<WebMethod()> Public Function helloworld_or_any_name_varaiable(ByVal my_varaiable As String) As String
'create a function by assinging a variable(sub string from the value ) show as string
helloworld_or_any_name_varaiable = "hi world, " & my_varaiable
'function= value of function = variable value assigned = hi world
End Function

End Class




<WebMethod()> Public Function helloworld_or_any_name_varaiable(ByVal my_varaiable As String) As String
return "hi world, " & my_varaiable
End Function

benq
10-16-2006, 02:01 PM
hi

thanks for ur reply

i meant can you look at my comments and see if i done that right?

thanks

sirpelidor
10-16-2006, 04:47 PM
'create a function by assinging a variable(sub string from the value ) show as string


-its ok to use the variable name my_varaiable as long as your operation is still within the scope. You probably would only assign a local variable equal to my_varaiable if you want to keep track of something such as a loop and you don't want it to affect the orginal value...

'function= value of function = variable value assigned = hi world

-i think using function name equal to a variable was a vb6 or vbscript technique, i don't think you can do that in .net, follow my example, if you just want the function return a string variable, do: return my_varaiable

benq
10-18-2006, 10:00 AM
hi

thanks for that just a quick question how can you view a web page on different browser for example my default is firefox and i want view in ie.

thanks

sirpelidor
10-18-2006, 11:14 AM
this link (http://blogs.dotnetgerman.com/alexonasp.net/PermaLink,guid,b6f16e30-95f0-4a8d-89ee-b3d8633a6ae9.aspx) shows you how to change default browser...

benq
10-18-2006, 11:20 AM
thanks again dude :)