Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View more than 100 items in Immediate window

Status
Not open for further replies.

jubble

Programmer
Mar 6, 2002
207
GB
Got one that's been nagging me for ages...

In the Immediate window, if you print all the properties of an object and there's more than 100 it will only display the first hundred and then say

< More... (The first 100 of 161 items were displayed.) >

Is it possible to page through each hundred items or get the whole lot?
 
Dunno, but as a work around, output the first 1 - 100 (For i - 1 to 100) check the results, then do 101 - 161.

Or just output the whole lot to a text file rather than the immediate windows?


------------------------
Hit any User to continue
 
sorry, I'll explain a bit better...

let's say you have a datagrid with 100 rows.

at a break in the code you type in the Immediate window:

? datagrid1.rows

this provides you with a bulk load of information in the Immediate window as there are 107 rows of properties/items/objects for datagrid1.

the problem is only the first 100 are shown.

how do we access the rest of them?


 
jubble - I've got a feeling that the immediate pane's buffer will only hold that many lines. Thus in order to see them, either output the properties/items/objects in blocks of 100, or output the whole lot to a text file.


------------------------
Hit any User to continue
 
Rick,

OK, bad example.

The point I'm trying to make is how to see more than 100 items?

If it's an array or collection it's very basic to iterate through each one (even easier in VB6 when we could do a for loop in the immediate window) but what about an object that has over 100 properties (hence the rows example which for the control I'm using has tonnes of info besides values). We can't iterate through the properties/objects of an object using a simple index number (or can we?) so there comes a time when it would be nice to have a huge list of the 200 properties and objects and their values associated with the parent object.

I'm in the process of getting a decent example together...bear with me.

SiJP,

I'm not aware of the ability to put a command in the immediate window that outputs to a text file...how is this done?
 
jubble, you won't necessary be able to do an output directly from the immediate window ... but you could write a function to do it, so all you call is: ?OuputProperties(myObject, "C:\mylist.txt")

Air Code:
Code:
Public Function OutputProperties(oObject as Object, sFile as string) as Boolean
On error resume next

dim str as string
Dim prp as property
for each prp in oObject.Properties
str = str & vbcrlf & prp.name & " " & prp.value
Next

Open sFile For Output As #1
Print #1, str
Close #1

End Function


SOmething like that anyway..

------------------------
Hit any User to continue
 
OK Rick here's an example

Project with 2 forms

Form 1 has button

In the modular declarations area for Form1:

Private oForm as new Form2

In the button event of Form1 just put any old code so you can set a breakpoint and access the Immedaite window

dim x as integer
x=1

Run code...hit button...goto immediate window

in immediate window type

? oForm

there should be 166 items in oForm but we can only see 100

This is a mixture of objects that as far as I know cannot be accessed through iteration. Murphy's law states that everytime I try to access values using this method the property name I'm looking for will be in the region w-z which is always past the 100 item limit.

Have a go, I'd be very surprised if you've never come across this problem before. If you haven't maybe you could let me know what you do instead.(Please don't mention 'Locals' or 'Me' window because they chew up my memory and processor due to the number of 3rd party controls I have on a lot of forms).

SiJP, I think you've got a good idea there to write the code from a function but there is no properties collection for an object that can be accessed through iteration, your code looks like VB6 or VBA code that doesn't work in VB.Net

There is something similar in object.gettype.getproperties but this doesn't store the values of the properties. What I really need is exactly what is shown in the immediate window list ie...

[objectname]:[objectvalue]
 
NNNNNOOOOOOOOOOOOOOOOOOoooooooooooooooooooooooooooooooooo............
I kind of knew you were going to say it but I'm still gutted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top