Call ByVal ByRef StrPtr Address.
Please Run a Code for me and post me the results in a Reply to this thread .
Hi
First just to keep in the spirit of Forum Rules I posted a similar request here last week
http://www.mrexcel.com/forum/excel-q...n-code-me.html
this was further related to a further Thread.
http://www.mrexcel.com/forum/excel-q...ml#post4415958
and in particular this post:
http://www.mrexcel.com/forum/excel-q...ml#post4413433
_. I am looking at the way the address of a String Type Variable may change in the running of a program which references it , makes copies of it , and changes its value. As this may be affected a lot by different systems, I am trying to get a spread of results from running a test code in different systems.
_. I have a code prepared below. If anyone has the time i would be grateful if they could copy the code to a spare code module, run the code for me, hit Ctrl G to get the Immediate Window up, then copy the results from the Immediate Window and paste those results in a reply to this thread.
_. I would be grateful if you could tell me what versions of XL you are using. ( In case the code does not do that correctly, as it should )*** And possibly also brief details of which computer. But that is not essential if you do not wish to disclose that.
_ ( I am using PC only: XL 2003 ; XL 2007 ; and XL 2010 ) I would be interested in particular for results from Excel Versions above XL 2010. But also results from earlier versions would be OK for me to compare with my results.
_. Here is a typical set of Results one should get:
( This I got this Today from running the code
in XL 2007 (Vista Aspire 4810TZG 1.3GHz CPU ) )
_. So these are basically the results from a run in your Excel thast I would like you too paste into a reply for me:
Using Excel 2007
12 Ads. main program-~~~~- StrPtr(x) 0
14 Ads. main program-~~~~- StrPtr(x) 357871820
16 Ads. main program-~~~~- StrPtr(x) 395523644
18 Ads. main program-~~~~- StrPtr(x) 0
30 Ads. main program-~~~~- StrPtr(x) 395523644
40 Ads. mySubByVal-~~~~-- StrPtr(c) 357871820
50 Ads. mySubByVal-~~~~-- StrPtr(c) 395523404
60 Ads. mySubByValcChange StrPtr(c) 357871820
70 Ads. mySubByValcChange StrPtr(c) 357871820
80 Ads. mySubByVal-~~~~-- StrPtr(c) 357871820
90 Ads. main program-~~~~- StrPtr(x) 395523644
100 Ads. main program-~~~~ StrPtr(x) 395523644
110 Ads. mySubByRef-~~~~-- StrPtr(c) 395523644
120 Ads. main program-~~~~ StrPtr(x) 395523644
130 Ads. mySubByRefcChange StrPtr(c) 395523644
140 Ads. mySubByRefcChange StrPtr(c) 395524524
150 Ads. main program-~~~~ StrPtr(x) 395523404
160 Ads. main program-~~~~ StrPtr(x) 395523404
170 Ads. mySubByRefcChange StrPtr(c) 395523404
180 Ads. main program-~~~~ StrPtr(x) 395523644
190 Ads. main program-~~~~ StrPtr(x) 395523644
200 Ads. mySubByRefcChange StrPtr(c) 395523644
210 Ads. mySubByVal-~~~~-- StrPtr(c) 395523644
220 Ads. main program-~~~~ StrPtr(x) 395524524
230 Ads. main program-~~~~ StrPtr(x) 395524524
240 Ads. mySubByVal-~~~~-- StrPtr(c) 357871820
250 Ads. mySubByVal-~~~~-- StrPtr(c) 395523644
260 Ads. mySubByValcChange StrPtr(c) 357871820
270 Ads. mySubByValcChange StrPtr(c) 357871820
280 Ads. mySubByVal-~~~~-- StrPtr(c) 357871820
300 Ads. mySubByRef-~~~~-- StrPtr(c) 395524524
310 Ads. main program-~~~~ StrPtr(x) 395524524
320 letting x = 111111
330 Ads. main program-~~~~ StrPtr(x) 395523404
340 Ads. mySubByRef-~~~~-- StrPtr(c) 395523404
350 Ads. main program-~~~~ StrPtr(x) 395523404
360 Ads. mySubByRefcChange StrPtr(c) 395523404
370 Ads. main program-~~~~ StrPtr(x) 395524524
_....................
Here are the Code(s):
The code to run is the first
Sub TestByValByRefStrPtrTiddlyFoo()
There are 5 additional Sub Routines which it calls.
All codes are in the Code window below. All should be copied to any spare Normal Module or Sheet Code Module
_.........................................
Many thanks in advance.
No Rush. - Anyone when you have the time ( the more the better!! )
Alan
_..........................
P.s. Does anyone know a code that will give you the basic brief details of the computer you are using? I could add that to save a bit of time in the future for anyone helping. (*** I found a bit to get the Excel version- That is a function called from Line 2 of the main code.. so should the code error, then I expect that is the most likely cause!?. )
P.P.s.
This File has the codes in it, in The Code Module for Sheet "LineNumbersEmpties"
https://app.box.com/s/lalxqrzrzjexpb0vmgufxf085elbuern
P.P.P.s. Some other of my test results here:
http://www.excelforum.com/developmen...ml#post4310473
Bookmarks