Re: String Reference Type



On Feb 10, 4:38 am, "Jonathan Wood" <jw...@xxxxxxxxxxxxxxxx> wrote:
Lars,

No, Strings in Pascal (and ADA as I reacll) are tru types.

This appears to be to me but I don't know what "no" refers to, or what "tru
types" are.

I could be wrong but it seems to me you are confusing terms. I'm not that
familiar with Delphi but a reference in C++ is different from a .NET
reference type. I don't know the exact criteria used to determine value or
reference type, but to me a reference type is a pointer, and so any type
that requires a pointer seems it would be a good candidate. And as far as
I'm concerned, all strings require pointers, whether they are made available
to the language that uses them or not. (Certainly, it wouldn't make sense to
ever store a string in a register or even on the stack.)

Don't know about C# but I hope the compiler takes care of this. By
references or not is not of interest. What is of interest is if you have
the option to use call by value for strings or if all parameters are
treated as references. Can you use call by value in C# how do you use call
by value?

According tohttp://www.knowdotnet.com/articles/referencetypes2.html, "One
of the most common mistakes developers make when learning .NET is confusing
Reference and Value Types with Passing values by Reference or Value." Again,
I think you are confusing terms.

--
Jonathan Wood
SoftCircuits Programminghttp://www.softcircuits.com

OK...now suppose I have the following code:

<script runat="server">
Class MyInt
Public MyValue As Integer
End Class

Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim x As New MyInt

...................
...................
...................
End Sub
</script>

If I am not wrong, the Dim line in the Page_Load sub "creates space in
the heap & returns a pointer (say, 0x000001)". To whom does the Dim
line return the pointer?

Please correct me if I am wrong.
.



Relevant Pages

  • Re: Dynamic References to Word?
    ... Sub ListExcelReferences() ... Dim i As Long ... First set the reference manually in the VBE under Tools, ... On Error GoTo ERROROUT ...
    (microsoft.public.excel.programming)
  • Re: Dynamic References to Word?
    ... Sub ListExcelReferences() ... Dim i As Long ... .ColorIndex = xlAutomatic ... First set the reference manually in the VBE under Tools, ...
    (microsoft.public.excel.programming)
  • Re: Before Double Click
    ... Yes, but in the routine where you pass the object reference, you when you ... Dim rngVal As Range ... Sub EFG(ByVal r1 As Range, ByRef r2 As Range) ...
    (microsoft.public.excel.programming)
  • Re: Auto Load Add-In
    ... you posted that will unload the addin. ... Sub ListAddins() ... Dim adn As AddIn ... I also assume the reason you want to add a project reference to the addin to ...
    (microsoft.public.excel.programming)
  • Re: Question on LSP
    ... Sure, the developer must keep track of which type has been assigned to each pointer to manage complexity in creating the design, which is why the 'T' is in T*. ... Subtyping is a relation which does not ... Those object types are completely orthogonal to the semantics of being an object reference. ... aggregate references, is the aggregate of referenced objects or target ...
    (comp.object)