+ Reply to Thread
Results 1 to 3 of 3

Call ByVal ByRef StrPtr Address. Please Run a Code for me and post me the results.

  1. #1
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Call ByVal ByRef StrPtr Address. Please Run a Code for me and post me the results.

    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

    Please Login or Register  to view this content.
    _.........................................



    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
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Call ByVal ByRef StrPtr Address. Please Run a Code for me and post me the results.

    Hello Mr. Alan
    I'm using office 2013 64bit and windows 10 64 bit
    Here's the results in the immediate window
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Call ByVal ByRef StrPtr Address. Please Run a Code for me and post me the results.

    Hi YasserKhalil
    Quote Originally Posted by YasserKhalil View Post
    .....
    I'm using office 2013 64bit and windows 10 64 bit
    Here's the results in the immediate window
    .......
    Thankyou very much
    I can see some interesting new results, differing from many I have had to date.
    This will be very helpful
    Alan Elston

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Combine Private Sub Worksheet_Change(ByVal Target As Range) VBA Code on same worksheet
    By mark_luke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2022, 04:48 PM
  2. VarPtr, StrPtr, ObjPtr - can't figure where to start converting Vb6 to VB.NET
    By Coleman34 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2015, 11:05 AM
  3. Help Merging Two Pieces of ByVal Target As Range Code
    By DaveBre in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2014, 06:39 PM
  4. [SOLVED] Learning differences between ByVal and ByRef
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-24-2013, 07:48 PM
  5. Replies: 1
    Last Post: 06-03-2012, 09:07 AM
  6. Replies: 2
    Last Post: 10-06-2009, 06:21 AM
  7. Replies: 1
    Last Post: 07-12-2006, 11:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1