The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Close some windows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ulrich.kun1

Germany
9 Posts

Posted - 07/30/2003 :  05:02:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic

I try to close windows by giving the beginning-charakter to a funktion.
The second code segment is working, while the first doesn't.
Although Destroy() and Close() are part of the same class(OriginObject).
Probably it's a quite simple mistake, but I can't find it at the moment....

Thanks for helping!

//The following doesn't work!

void hidewindows(char anfangsb)
{
Project pr;
PageBase pg;
string Source;
bool bshow;
foreach (pg in pr.Pages)
{
pg.GetName(Source);
if (Source.GetAt(0) == anfangsb )
{
bshow = FALSE;
pg.Show(bshow);
}
}
}

//while this code is working fine!
void closewindows(char anfangsb)
{
Project pr;
PageBase pg;
string Source;

foreach (pg in pr.Pages)
{
pg.GetName(Source);
if ( (Source.GetAt(0) == anfangsb) )
{
pg.Destroy();
}
}
}

Laurie

USA
404 Posts

Posted - 07/30/2003 :  10:46:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try the following modification that uses the SetShow method of PageBase class:

void hidewindows(char anfangsb) 
{
Project pr;
PageBase pg;
string Source;
foreach (pg in pr.Pages)
{
pg.GetName(Source);
if (Source.GetAt(0) == anfangsb )
{
pg.SetShow(PAGE_HIDDEN);
}
}
}



P.S. Make sure you have the latest Origin update...select Help:Check for Updates.

OriginLab Technical Support
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000