Option Explicit Sub ttt(ByRef ttt As String) ttt = "He-He" End Sub Sub ttt2(ByRef ttt As Variant) ttt = "He-He" End SubThen I tested it under VFP in command window - it works when you pass a string to VB object by reference. THe test was following:
LOCAL loEClient LOCAL lcResponseCode <b>lcResponseCode = "EMPTY"</b> loEClient=CREATEOBJECT('MyObject') loEClient.GetResponseCode(<b>@</b>lcResponseCode) ? 'Response Code: ' + lcResponseCode>>>>Any difference if you pass the parameter BY REFERENCE?
LOCAL loEClient >>LOCAL lcResponseCode >><b>lcResponseCode = REPLICATE(CHR(0), 255)</b> >>loEClient=CREATEOBJECT('MyObject') >><b>loEClient.GetResponseCode(@lcResponseCode)</b> >>? 'Response Code: ' + lcResponseCode >>>
>The sample code shows how most of the work can be done with JScript but >when it comes time to retrieve the Get method results from the COM object, >the JScript code must pass the object to a VBScript function >that does the GETs and then returns the results back to the JScript via a >VBArray which is supported by JScript. For example, > >//Start JScript >.... >oEClient = new ActiveXObject("My object"); >.... >//Do Sets... >.... >VBarray = new VBArray(VBdoTransaction(oEClient)); >Jarray = VBarray.toArray(); > >.... > >//End JScript > >< SCRIPT LANGUAGE="VBScript" RUNAT=SERVER> >option explicit > >Function VBdoTransaction(oEClient) >Dim vbArray(10) >Dim vbrc >. >. >. > >VBdoTransaction = vbArray > >End Function >< /SCRIPT> >