473,748 Members | 8,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ArrayTo Print As Variant)
Dim zz As Integer, xx As Integer
For zz = 1 To UBound(ArrayToP rint, 1)
For xx = 1 To UBound(ArrayToP rint, 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.Ge tUpperBound(0); zz++)
{
for (int xx = 0; xx < ArrayToPrint.Ge tUpperBound(1); xx++)
{
Debug.WriteLine (ArrayToPrint[zz, xx]);
}
Debug.WriteLine ("");
}
Debug.WriteLine ("");
}
Thanks

Alan
Dec 20 '05 #1
0 1385

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

Similar topics

5
2101
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 ("DEBUG: Image is by pixels" % (self.fname,x,y))
2
1735
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
2760
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, binded to dataview. Here's a catch - whenever I select a client, and then find a car which belongs to this client, and click on empty space in datagrid (that is in gray area below rows) - I get "Index was outside the bounds of the array" error......
3
16721
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
30999
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 objects named Object1, Object2, and Object3. Then I would do something like this For n = 1 to 3 myobject = Object & n myobject.myproperty = "whatever" End for
5
2852
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 A97 runtime environment might ever be cause for concern. I've noticed no symptoms to indicate a problem. Are there drawbacks to this practice?
6
4118
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 make it work in Release build? Bill
2
22880
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 openning, fetching, and closing of a cursor. Things are fine if only one of the two parameters was set to 1. When run with both parameters turned on, "dba_test_dts 1, 1", DTS source (tab) preview fails because it thinks no row was returned....
40
1955
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
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.