<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: New TypedValue Usage (LispDataType.DottedPair) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553494#M69152</link>
    <description>I may be way off on this&lt;BR /&gt;
but if you're looking for the equivalent of a dotted pair (list),&lt;BR /&gt;
use a Hashtable for your construct:&lt;BR /&gt;
&lt;BR /&gt;
System.Colections.Hashtable MyDottedPairs = new Hashtable();&lt;BR /&gt;
&lt;BR /&gt;
Then:&lt;BR /&gt;
&lt;BR /&gt;
MyDottedPairs.Add(key, value);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
    <pubDate>Wed, 09 Sep 2009 13:00:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-09-09T13:00:35Z</dc:date>
    <item>
      <title>New TypedValue Usage (LispDataType.DottedPair)</title>
      <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553493#M69151</link>
      <description>I am starting to slowly migrate some of my LISP functions into .NET.  Since I obviously can't do it all at once I am migrating slowly by using the "LispFunction" class in order to write chunks of code in .NET that can be called from the "left over" LISP routine code.  The return value from this class\function is a "Autodesk.AutoCAD.DatabaseServices.ResultBuffer" (which is changed into a list by the time it is returned to the LISP code).  Right now I am returning a DataSet (that I have already obtained before the below code) as a "list of lists".&lt;BR /&gt;
&lt;BR /&gt;
This code currently works just fine:&lt;BR /&gt;
{code}&lt;BR /&gt;
resBuf = New ResultBuffer()&lt;BR /&gt;
'read data set&lt;BR /&gt;
For Each dt As System.Data.DataTable In dataSet.Tables&lt;BR /&gt;
    For Each dr As DataRow In dt.Rows&lt;BR /&gt;
        'add each row into result buffer as a list&lt;BR /&gt;
        resBuf.Add(New TypedValue(LispDataType.ListBegin, -1))&lt;BR /&gt;
        For Each dc As System.Data.DataColumn In dt.Columns&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.ListBegin, -1))&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.Text, dc.ColumnName))&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.Text, dr.Item(dc)))&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.ListEnd, -1))&lt;BR /&gt;
        Next&lt;BR /&gt;
        resBuf.Add(New TypedValue(LispDataType.ListEnd, -1))&lt;BR /&gt;
    Next&lt;BR /&gt;
Next&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
BUT, what I want is to return a "list of dotted pairs", which I assume would be something like this:&lt;BR /&gt;
(because I know "LispDataType.DottedPair" is valid (value=5018)...I just don't know how to use it)&lt;BR /&gt;
{code}&lt;BR /&gt;
resBuf = New ResultBuffer()&lt;BR /&gt;
'read data set&lt;BR /&gt;
For Each dt As System.Data.DataTable In dataSet.Tables&lt;BR /&gt;
    For Each dr As DataRow In dt.Rows&lt;BR /&gt;
        'add each row into result buffer as a list&lt;BR /&gt;
        resBuf.Add(New TypedValue(LispDataType.ListBegin, -1))&lt;BR /&gt;
        For Each dc As System.Data.DataColumn In dt.Columns&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.DottedPair, dc.ColumnName))&lt;BR /&gt;
            resBuf.Add(New TypedValue(LispDataType.DottedPair, dr.Item(dc)))&lt;BR /&gt;
        Next&lt;BR /&gt;
        resBuf.Add(New TypedValue(LispDataType.ListEnd, -1))&lt;BR /&gt;
    Next&lt;BR /&gt;
Next&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
...but that is obviously not the right syntax because one data type of DottedPair would need 2 arguments (not 2 dotted pairs w/ one arg each).&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help?</description>
      <pubDate>Wed, 09 Sep 2009 01:20:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553493#M69151</guid>
      <dc:creator>awerning</dc:creator>
      <dc:date>2009-09-09T01:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: New TypedValue Usage (LispDataType.DottedPair)</title>
      <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553494#M69152</link>
      <description>I may be way off on this&lt;BR /&gt;
but if you're looking for the equivalent of a dotted pair (list),&lt;BR /&gt;
use a Hashtable for your construct:&lt;BR /&gt;
&lt;BR /&gt;
System.Colections.Hashtable MyDottedPairs = new Hashtable();&lt;BR /&gt;
&lt;BR /&gt;
Then:&lt;BR /&gt;
&lt;BR /&gt;
MyDottedPairs.Add(key, value);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
      <pubDate>Wed, 09 Sep 2009 13:00:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553494#M69152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-09T13:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: New TypedValue Usage (LispDataType.DottedPair)</title>
      <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553495#M69153</link>
      <description>{code}[LispFunction("l2")]&lt;BR /&gt;
        public static ResultBuffer LTest2(ResultBuffer rb)&lt;BR /&gt;
        {&lt;BR /&gt;
            ResultBuffer res = new ResultBuffer();&lt;BR /&gt;
            res.Add(new TypedValue((int)LispDataType.ListBegin));&lt;BR /&gt;
            res.Add(new TypedValue((int)LispDataType.Int16, 1));&lt;BR /&gt;
            res.Add(new TypedValue((int)LispDataType.Int16 ,2));&lt;BR /&gt;
            res.Add(new TypedValue((int)LispDataType.DottedPair));&lt;BR /&gt;
            return res;&lt;BR /&gt;
        }{code}

Edited by: XSFHLZH on Sep 9, 2009 2:09 PM</description>
      <pubDate>Wed, 09 Sep 2009 14:09:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553495#M69153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-09T14:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: New TypedValue Usage (LispDataType.DottedPair)</title>
      <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553496#M69154</link>
      <description>Thanks XSFHLZH!  That is exactly what I needed.</description>
      <pubDate>Wed, 09 Sep 2009 17:08:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2553496#M69154</guid>
      <dc:creator>awerning</dc:creator>
      <dc:date>2009-09-09T17:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: New TypedValue Usage (LispDataType.DottedPair)</title>
      <link>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2712639#M69155</link>
      <description>&lt;P&gt;The HashTable and ArrayList are&amp;nbsp;.NET 1.x-era classes that suffer from&lt;/P&gt;&lt;P&gt;the performance overhead of boxing/unboxing (e.g., System.Object), and&lt;/P&gt;&lt;P&gt;their use should be avoided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In .NET 2.0 or later, Dictionary&amp;lt;TKey,TValue&amp;gt; is the replacment for the&lt;/P&gt;&lt;P&gt;HashTable, and List&amp;lt;T&amp;gt; is the replacement for ArrayList.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2010 02:21:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/new-typedvalue-usage-lispdatatype-dottedpair/m-p/2712639#M69155</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-09T02:21:26Z</dc:date>
    </item>
  </channel>
</rss>

