Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <66c79eb1$0$706$14726298@news.sunsite.dk>
Deutsch   English   Français   Italiano  
<66c79eb1$0$706$14726298@news.sunsite.dk>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.szaf.org!fu-berlin.de!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Thu, 22 Aug 2024 16:25:21 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New VSI post on Youtube
Newsgroups: comp.os.vms
References: <v9ehs5$3mqbj$1@dont-email.me> <v9idff$f9k4$1@dont-email.me>
 <v9iqln$hrs3$1@dont-email.me> <v9iro6$fql6$1@dont-email.me>
 <66bcf876$0$717$14726298@news.sunsite.dk>
 <66bcfbe3$0$717$14726298@news.sunsite.dk> <v9kske$uqhh$2@dont-email.me>
 <va04hl$2viks$2@dont-email.me> <66c397f6$0$716$14726298@news.sunsite.dk>
 <va226u$3ce14$1@dont-email.me> <va22l3$3cdrf$4@dont-email.me>
 <lik2d5Fkf4uU3@mid.individual.net> <va67af$6mpa$4@dont-email.me>
 <va7t4k$h0sn$2@dont-email.me>
Content-Language: en-US
From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk>
In-Reply-To: <va7t4k$h0sn$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 81
Message-ID: <66c79eb1$0$706$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 0f09630f.news.sunsite.dk
X-Trace: 1724358322 news.sunsite.dk 706 arne@vajhoej.dk/68.14.27.188:51967
X-Complaints-To: staff@sunsite.dk

On 8/22/2024 1:39 PM, Simon Clubley wrote:
> On 2024-08-21, Dave Froble <davef@tsoft-inc.com> wrote:
>> On 8/20/2024 1:34 PM, bill wrote:
>>> On 8/20/2024 8:36 AM, Simon Clubley wrote:
>>>> In languages with dynamic associative arrays (such as PHP), I simulate
>>>> this by returning an associative array from a function call with both
>>>> status and value fields. Makes coding _so_ much cleaner and robust.
>>>
>>> And probably much harder to understand in anything but the most
>>> trivial usage.
>>
>> Would that not be rather clear with adequate comments about what is being done?
> 
> Look at the example Arne posted. Very clean and very easy to understand
> without having to use comments (and I am actually a fan of the liberal
> use of comments. :-) ).

The same example in older VB.NET:

Imports System
Imports System.Collections.Generic

Namespace MR
     Public Class Program
         Public Shared Function FourOps(a As Double, b As Double) As 
IDictionary(Of String, Double)
             Dim res As New Dictionary(Of String, Double)()
             res("plus") = a + b
             res("minus") = a - b
             res("multiply") = a * b
             res("divide") = a / b
             Return res
         End Function
         Public Shared Sub Main(args As String())
             Dim a As Double = 3.0
             Dim b As Double = 2.0
             Dim res As IDictionary(Of String, Double) = FourOps(a, b)
             Console.WriteLine("{0} + {1} = {2}", a, b, res("plus"))
             Console.WriteLine("{0} - {1} = {2}", a, b, res("minus"))
             Console.WriteLine("{0} * {1} = {2}", a, b, res("multiply"))
             Console.WriteLine("{0} / {1} = {2}", a, b, res("divide"))
             Console.ReadKey()
         End Sub
     End Class
End Namespace

In newer VB.NET it looks like:

Imports System
Imports System.Collections.Generic

Namespace MR
     Public Class Program
         Public Shared Function FourOps(a As Double, b As Double) As 
IDictionary(Of String, Double)
             Return New Dictionary(Of String, Double)() From { _
                 {"plus", a + b}, _
                 {"minus", a - b}, _
                 {"multiply", a * b}, _
                 {"divide", a / b} _
             }
         End Function
         Public Shared Sub Main(args As String())
             Dim a As Double = 3.0
             Dim b As Double = 2.0
             Dim res As IDictionary(Of String, Double) = FourOps(a, b)
             Console.WriteLine("{0} + {1} = {2}", a, b, res("plus"))
             Console.WriteLine("{0} - {1} = {2}", a, b, res("minus"))
             Console.WriteLine("{0} * {1} = {2}", a, b, res("multiply"))
             Console.WriteLine("{0} / {1} = {2}", a, b, res("divide"))
             Console.ReadKey()
         End Sub
     End Class
End Namespace

But I suspect that David as a Basic connoisseur consider that dictionary
initializer syntax copied directly from C# an abomination - curly
brackets is not real Basic.

Arne