473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Print an array to the debug windows

In VB6 I have a routine that accepts a 2D array and prints it to the debug
windows. The array can be of any type (eg integer, string, double etc)....

Public Sub DPArray(ArrayToPrint As Variant)
Dim zz As Integer, xx As Integer
For zz = 1 To UBound(ArrayToPrint, 1)
For xx = 1 To UBound(ArrayToPrint, 2)
Debug.Print ArrayToPrint(zz, xx);
Next xx
Debug.Print
Next zz
Debug.Print
End Sub

How can I translate this to Csharp? I have tried the following but get an
"Cannot apply indexing with [] to an expression of type 'System.Array'"
error.

public static void DPArray(Array ArrayToPrint)
{
for (int zz = 0; zz < ArrayToPrint.GetUpperBound(0); zz++)
{
for (int xx = 0; xx < ArrayToPrint.GetUpperBound(1); xx++)
{
Debug.WriteLine(ArrayToPrint[zz, xx]);
}
Debug.WriteLine("");
}
Debug.WriteLine("");
}
Thanks

Alan
Dec 20 '05 #1
0 1354

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Graham Nicholls | last post by:
Thanks to Richard and Alex, I'm doing this: seg_stru=">BHH" seg_data=self.fhand.read(struct.calcsize(seg_stru)) data=struct.unpack(seg_stru,seg_data) x=seg_data y=seg_data if debug: print...
2
by: abd el moniem | last post by:
i want to make an array of a textbox so please who know the answer please send the full code for it and if there is some thing else i have to do kind regards abd el moniem
0
by: Eugene | last post by:
Hello all, I've been trying to figure this out for a few days now, and still have no clue what's going on... I have a few related tables in MS Access (Clients, Cars, Sales), and a datagrid,...
3
by: Gunawan | last post by:
In vs 6 I can use debug.print as alternatif debugging value at runtime. Which function that I can use in C# 2005 Express for windows form apps? TIA, Gunawan
10
by: Altman | last post by:
In vb 6 you use to be able to create an array of objects and I can't seem to figure this out in .NET. I figured you can't make this but I was wondering how I could do it if I had for instance 3...
5
by: MLH | last post by:
I use a fair number of debug.print statements. My apps are fairly well 'peppered' with them. I've often wondered if leaving them in the mdb, creating and rolling out an mde intended for use in the...
6
by: swartzbill2000 | last post by:
Hello, I have a VB 2005 Express project with a TraceListener-derived class to route Debug.Print output to a log file. It works fine for Debug builds. What is the correct combination of changes to...
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
40
by: Summercool | last post by:
I wonder in PHP, can you have a function like print_debug($foo); and it will print out: $foo is: 3 that is, it will print out, most importantly, the variable name, as
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.