byref

Classic ASP - passing a property as byref

感情迁移 提交于 2020-11-29 09:25:07
问题 In classic ASP I have an object, call it bob . This then has a property called name , with let and get methods. I have a function as follows: sub append(byref a, b) a = a & b end sub This is simply to make it quicker to add text to a variable. I also have the same for prepend , just it is a = b & a . I know it would be simple to say bob.name = bob.name & "andy" , but I tried using the above functions and neither of them work. The way I am calling it is append bob.name, "andy" . Can anyone see

Classic ASP - passing a property as byref

你离开我真会死。 提交于 2020-11-29 09:24:26
问题 In classic ASP I have an object, call it bob . This then has a property called name , with let and get methods. I have a function as follows: sub append(byref a, b) a = a & b end sub This is simply to make it quicker to add text to a variable. I also have the same for prepend , just it is a = b & a . I know it would be simple to say bob.name = bob.name & "andy" , but I tried using the above functions and neither of them work. The way I am calling it is append bob.name, "andy" . Can anyone see

Pass by Ref Textbox.Text

你。 提交于 2020-01-14 22:43:08
问题 I currently have something that I want to pass a textbox.text by ref. I don't want to pass the whole textbox and I want the function to change the text along with returning the other variable. public int function(int a, int b, string text) { //do something if (a + b > 50) { text = "Omg its bigger than 50!"; } return (a + b); } Is there a way to pass the Textbox.text by ref and change it inside the function? 回答1: You can't pass a property by ref, only a field or a variable. From MSDN :

Pass by Ref Textbox.Text

╄→гoц情女王★ 提交于 2020-01-14 22:42:40
问题 I currently have something that I want to pass a textbox.text by ref. I don't want to pass the whole textbox and I want the function to change the text along with returning the other variable. public int function(int a, int b, string text) { //do something if (a + b > 50) { text = "Omg its bigger than 50!"; } return (a + b); } Is there a way to pass the Textbox.text by ref and change it inside the function? 回答1: You can't pass a property by ref, only a field or a variable. From MSDN :

Pass by Ref Textbox.Text

别等时光非礼了梦想. 提交于 2020-01-14 22:42:20
问题 I currently have something that I want to pass a textbox.text by ref. I don't want to pass the whole textbox and I want the function to change the text along with returning the other variable. public int function(int a, int b, string text) { //do something if (a + b > 50) { text = "Omg its bigger than 50!"; } return (a + b); } Is there a way to pass the Textbox.text by ref and change it inside the function? 回答1: You can't pass a property by ref, only a field or a variable. From MSDN :

Why is it not necessary to indicate ByVal/ByRef anymore?

落爺英雄遲暮 提交于 2019-12-28 04:00:13
问题 I just installed Visual Studio 2010 Service pack (proposed on Windows Update), and I can see a new feature on the "intellisense" that means when I write a Function or Sub in VB.NET it doesn't auto-complete parameters with ByRef or ByVal ... 1) Is there anyway that I can configure this option back to how it was before? 2) If I don't specify ByX , which one is used by default? (it seems like it is always ByRef ) 回答1: Tim covered what you asked directly, but something else to keep in mind is

VB dictionary of Objects ByRef

萝らか妹 提交于 2019-12-25 01:59:46
问题 I want to create a Dim Dict As New Dictionary(Of String, Object) which would point my strings to specific COM Object classes, i.e. Dict.Add("NODES",Visum.Net.Nodes) I'd have around 20 keys in dictionary, each pointing to a different class within COM object. Basically it works, but I'm afraid it's very heavy (dict of 20 instances of big classes) and not neccessary - I'm passing whole object to a dict, while I really need just kind of pointer ( ByRef ). Is there a more clever way to do it? PS.

Why can't a function with byref be converted directly to delegate?

岁酱吖の 提交于 2019-12-19 07:23:47
问题 Under normal circumstances, F# functions can be converted to delegates by calling new DelegateType and passing in the function as an argument. But when the delegate contains byref parameter, this is not possible directly. For example the code: type ActionByRef<'a> = delegate of 'a byref -> unit let f (x:double byref) = x <- 6.0 let x = ref 42.0 let d = new ActionByRef<_>(f) won't compile, giving the following error: This function value is being used to construct a delegate type whose

'ByRef' parameter '<parametername>' cannot be used in a lambda expression

我是研究僧i 提交于 2019-12-18 08:58:50
问题 I'm using SharpZipLib to compress files. The library is wrapped in a plugin interface, in a separate DLL. I pass the plugin dll a ByRef parameter to keep track of the compression progress. SharpZipLib, while compressing, will periodically call a delegate sub passed when launching the compression. I can't figure out how to update the ByRef parameter when the delegate is called. If I try to assign the ByRef variable in the body of a lamba expression, I get a 'ByRef' parameter '<parametername>'

F# member constraints + ^a byref parameters

左心房为你撑大大i 提交于 2019-12-18 04:51:11
问题 After some playing around F# member constraints feature and writing function like this: let inline parse< ^a when ^a : (static member Parse: string -> ^a) > s = (^a: (static member Parse: string -> ^a) s) That works perfectly fine: let xs = [ "123"; "456"; "999" ] |> List.map parse<int> I'm trying to write other func tryParse , that uses static method TryParse and wraps the parse result into 'a option type for better support in F#. Something like this doesn't compiles: let inline tryParse s =