473,405 Members | 2,167 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,405 software developers and data experts.

problem accesing object after if else

Hi,

I have a problem accesing h, when i want to do h.Run() after the if else
structure, i get the following error: (see below for code)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project
Files\thuis\13december\Aviewerversie02\FileLoad.cs (417): The type or
namespace name 'h' could not be found (are you missing a using directive or
an assembly reference?)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project
Files\thuis\13december\Aviewerversie02\FileLoad.cs (418): The name 'h' does
not exist in the class or namespace 'Aviewerversie02.FileLoad'

How can i fix this?

Greetz
JC
LijstNode loper;

loper=(LijstNode)treeViewSequence.Nodes[0];
while(loper.Nodes.Count!=0)

{

if ( loper is GetImageNode )

{

GetImageNode h = (GetImageNode)loper;

}

else if ( loper is ViewNode )

{

ViewNode h = (ViewNode)loper;

}

else if ( loper is CastNode )

{

CastNode h = (CastNode)loper;

}

else if ( loper is FilterNode )

{

FilterNode h = (FilterNode)loper;

}

else if ( loper is TimerNode )

{

TimerNode h = (TimerNode)loper;

}

h.Run();

loper=(LijstNode)h;

loper=(LijstNode)loper.Nodes[0];

}
Nov 15 '05 #1
3 1141
You have to declare the variable outside of the condition blocks then set
the variable inside the conditions.

"Jeroen Ceuppens" <je*************@barco.com> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
Hi,

I have a problem accesing h, when i want to do h.Run() after the if else
structure, i get the following error: (see below for code)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project
Files\thuis\13december\Aviewerversie02\FileLoad.cs (417): The type or
namespace name 'h' could not be found (are you missing a using directive or an assembly reference?)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project
Files\thuis\13december\Aviewerversie02\FileLoad.cs (418): The name 'h' does
not exist in the class or namespace 'Aviewerversie02.FileLoad'

How can i fix this?

Greetz
JC
LijstNode loper;

loper=(LijstNode)treeViewSequence.Nodes[0];
while(loper.Nodes.Count!=0)

{

if ( loper is GetImageNode )

{

GetImageNode h = (GetImageNode)loper;

}

else if ( loper is ViewNode )

{

ViewNode h = (ViewNode)loper;

}

else if ( loper is CastNode )

{

CastNode h = (CastNode)loper;

}

else if ( loper is FilterNode )

{

FilterNode h = (FilterNode)loper;

}

else if ( loper is TimerNode )

{

TimerNode h = (TimerNode)loper;

}

h.Run();

loper=(LijstNode)h;

loper=(LijstNode)loper.Nodes[0];

}

Nov 15 '05 #2
Hi

That doesn't work either:
it put LijstNode h on top of the code, and this error shows up

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project
Files\thuis\13december\Aviewerversie02\FileLoad.cs (399): A local variable
named 'h' cannot be declared in this scope because it would give a different
meaning to 'h', which is already used in a 'parent or current' scope to
denote something else

I need the same variable because after the if else block, i Need to the same
operation h.run() wheter it is GetImageNode h, a ViewNode h,..........
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:ub**************@TK2MSFTNGP11.phx.gbl...
You have to declare the variable outside of the condition blocks then set
the variable inside the conditions.

"Jeroen Ceuppens" <je*************@barco.com> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
Hi,

I have a problem accesing h, when i want to do h.Run() after the if else
structure, i get the following error: (see below for code)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project Files\thuis\13december\Aviewerversie02\FileLoad.cs (417): The type or
namespace name 'h' could not be found (are you missing a using directive

or
an assembly reference?)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project Files\thuis\13december\Aviewerversie02\FileLoad.cs (418): The name 'h' does not exist in the class or namespace 'Aviewerversie02.FileLoad'

How can i fix this?

Greetz
JC
LijstNode loper;

loper=(LijstNode)treeViewSequence.Nodes[0];
while(loper.Nodes.Count!=0)

{

if ( loper is GetImageNode )

{

GetImageNode h = (GetImageNode)loper;

}

else if ( loper is ViewNode )

{

ViewNode h = (ViewNode)loper;

}

else if ( loper is CastNode )

{

CastNode h = (CastNode)loper;

}

else if ( loper is FilterNode )

{

FilterNode h = (FilterNode)loper;

}

else if ( loper is TimerNode )

{

TimerNode h = (TimerNode)loper;

}

h.Run();

loper=(LijstNode)h;

loper=(LijstNode)loper.Nodes[0];

}


Nov 15 '05 #3
I want to write a function for that, but then i hqve got another problem:
see in newsgroup dotnet.framework.compactframework : losing object type
information
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:ub**************@TK2MSFTNGP11.phx.gbl...
You have to declare the variable outside of the condition blocks then set
the variable inside the conditions.

"Jeroen Ceuppens" <je*************@barco.com> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
Hi,

I have a problem accesing h, when i want to do h.Run() after the if else
structure, i get the following error: (see below for code)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project Files\thuis\13december\Aviewerversie02\FileLoad.cs (417): The type or
namespace name 'h' could not be found (are you missing a using directive

or
an assembly reference?)

C:\Documents and Settings\Eindwerk\Mijn documenten\BARCO\Eindwerk\Project Files\thuis\13december\Aviewerversie02\FileLoad.cs (418): The name 'h' does not exist in the class or namespace 'Aviewerversie02.FileLoad'

How can i fix this?

Greetz
JC
LijstNode loper;

loper=(LijstNode)treeViewSequence.Nodes[0];
while(loper.Nodes.Count!=0)

{

if ( loper is GetImageNode )

{

GetImageNode h = (GetImageNode)loper;

}

else if ( loper is ViewNode )

{

ViewNode h = (ViewNode)loper;

}

else if ( loper is CastNode )

{

CastNode h = (CastNode)loper;

}

else if ( loper is FilterNode )

{

FilterNode h = (FilterNode)loper;

}

else if ( loper is TimerNode )

{

TimerNode h = (TimerNode)loper;

}

h.Run();

loper=(LijstNode)h;

loper=(LijstNode)loper.Nodes[0];

}


Nov 15 '05 #4

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

Similar topics

0
by: Linesh Gajera | last post by:
Hi, I have unique problem. I have configured RemotingServer running as Console Application and my Remoting object access Oracle database. My remoting object make call to Oracle database and...
8
by: srinivas.aki | last post by:
Hello Guys This is the small script I have. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
0
by: Gönen EREN | last post by:
I want to populate a datalist in edittemplate the probleme: i get an error while accesing the datagrid public void DataListEdit(Object src, DataListCommandEventArgs e ) { ...
4
by: Pk | last post by:
Hi, Im having a problem in forms. I have a mdi parent form named Main, and a child form named form1. >From Main form, i have a certain menu item that when clicked, it opens form1. But the...
2
by: ras26 | last post by:
I have a WebSite "App1" which has an external assembly "Lib1". Inside this external assembly we have developed some classes that derive from "System.Web.UI.Page". One of these pages is called...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
1
by: arturofonseca | last post by:
I have an event where attendants can register for online. This is 2 day event. I want to be able to disable the same lab on day2 when it has been selected on day1 (so attendants don't select the same...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
1
by: john20 | last post by:
Hi All, I am having a problem with accesing function in the page. i have a page say user.aspx in the page load method i am calling function to validate the user. it works fine when single...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.