1. ODBC namespace identifier

Hi,

I am using odbc.e with the name space identifier ODBC in the
Begin area of WinMain() window.

include odbc.e as ODBC



I have also included a library mss.ew of my own routines after odbc.

include mss.ew



Now, I have written a procedure in mss.ew which accesses ODBC:getData()
function, but ODBC name space identifier is not recognised.

I get following error:

D:\EUPHORIA\IDE\Projects\Syndicate ODBC\mss.ew:155
ODBC has not been declared
    		rec_data = ODBC:getData(sysmsgs_hndl)
    		              ^

Only when I move the concerned procedure to the General area of the window
where ODBC is accessed, the name space identifier is recognized and system
works fine.

Is it a problem with ODBC or am I doing something wrong?
How can I avoid having my own routine outside mss.ew?

Regards,
Rad.

new topic     » topic index » view message » categorize

2. Re: ODBC namespace identifier

Rad wrote:

> I am using odbc.e with the name space identifier ODBC in the
> Begin area of WinMain() window.
> 
> }}}
<eucode>
> include odbc.e as ODBC
> </eucode>
{{{

> 
> 
> I have also included a library mss.ew of my own routines after odbc.
> 
> }}}
<eucode>
> include mss.ew
> </eucode>
{{{

> 
> 
> Now, I have written a procedure in mss.ew which accesses ODBC:getData()
> function, but ODBC name space identifier is not recognised.
> 
> I get following error:
> 
> D:\EUPHORIA\IDE\Projects\Syndicate ODBC\mss.ew:155
> ODBC has not been declared
>     		rec_data = ODBC:getData(sysmsgs_hndl)
>     		              ^
> 
> Only when I move the concerned procedure to the General area of the window
> where ODBC is accessed, the name space identifier is recognized and system
> works fine.
> 
> Is it a problem with ODBC or am I doing something wrong?
> How can I avoid having my own routine outside mss.ew?

See section "Scope" in the reference manual:
     http://www.rapideuphoria.com/refman_2.htm#42

| A namespace identifier has local scope. It is known only within the file
| that declares it, i.e. the file that contains the include statement.
| Different files might define different namespace identifiers to refer to
| the same included file. 

When your library 'mss.ew' also contains a line such as
     include odbc.e as ODBC

then your program should work as expected.
     
Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

3. Re: ODBC namespace identifier

Juergen Luethje wrote:
> 
> Rad wrote:
> 
> > I am using odbc.e with the name space identifier ODBC in the
> > Begin area of WinMain() window.
> > 
> > }}}
<eucode>
> > include odbc.e as ODBC
> > </eucode>
{{{

> > 
> > 
> > I have also included a library mss.ew of my own routines after odbc.
> > 
> > }}}
<eucode>
> > include mss.ew
> > </eucode>
{{{

> > 
> > 
> > Now, I have written a procedure in mss.ew which accesses ODBC:getData()
> > function, but ODBC name space identifier is not recognised.
> > 
> > I get following error:
> > 
> > D:\EUPHORIA\IDE\Projects\Syndicate ODBC\mss.ew:155
> > ODBC has not been declared
> >     		rec_data = ODBC:getData(sysmsgs_hndl)
> >     		              ^
> > 
> > Only when I move the concerned procedure to the General area of the window
> > where ODBC is accessed, the name space identifier is recognized and system
> > works fine.
> > 
> > Is it a problem with ODBC or am I doing something wrong?
> > How can I avoid having my own routine outside mss.ew?
> 
> See section "Scope" in the reference manual:
>      <a
>      href="http://www.rapideuphoria.com/refman_2.htm#42">http://www.rapideuphoria.com/refman_2.htm#42</a>
> 
> | A namespace identifier has local scope. It is known only within the file
> | that declares it, i.e. the file that contains the include statement.
> | Different files might define different namespace identifiers to refer to
> | the same included file. 
> 
> When your library 'mss.ew' also contains a line such as
>      include odbc.e as ODBC
> 
> then your program should work as expected.

I think it needs mentioning that the include will not be included, parsed and
executed twice - it will simply be visible for use in mss.ew.

Alex

new topic     » goto parent     » topic index » view message » categorize

4. Re: ODBC namespace identifier

Alex Chamberlain wrote:
> 
> Juergen Luethje wrote:
> > 
> > Rad wrote:
> > 
> > > I am using odbc.e with the name space identifier ODBC in the
> > > Begin area of WinMain() window.
> > > 
> > > }}}
<eucode>
> > > include odbc.e as ODBC
> > > </eucode>
{{{

> > > 
> > > 
> > > I have also included a library mss.ew of my own routines after odbc.
> > > 
> > > }}}
<eucode>
> > > include mss.ew
> > > </eucode>
{{{

> > > 
> > > 
> > > Now, I have written a procedure in mss.ew which accesses ODBC:getData()
> > > function, but ODBC name space identifier is not recognised.
> > > 
> > > I get following error:
> > > 
> > > D:\EUPHORIA\IDE\Projects\Syndicate ODBC\mss.ew:155
> > > ODBC has not been declared
> > >     		rec_data = ODBC:getData(sysmsgs_hndl)
> > >     		              ^
> > > 
> > > Only when I move the concerned procedure to the General area of the window
> > > where ODBC is accessed, the name space identifier is recognized and system
> > > works fine.
> > > 
> > > Is it a problem with ODBC or am I doing something wrong?
> > > How can I avoid having my own routine outside mss.ew?
> > 
> > See section "Scope" in the reference manual:
> >      <a
> >      href="http://www.rapideuphoria.com/refman_2.htm#42">http://www.rapideuphoria.com/refman_2.htm#42</a>
> > 
> > | A namespace identifier has local scope. It is known only within the file
> > | that declares it, i.e. the file that contains the include statement.
> > | Different files might define different namespace identifiers to refer to
> > | the same included file. 
> > 
> > When your library 'mss.ew' also contains a line such as
> >      include odbc.e as ODBC
> > 
> > then your program should work as expected.
> 
> I think it needs mentioning that the include will not be included, parsed and
> executed twice - it will simply be visible for use in mss.ew.
> 
> Alex


Thanks Juergen, Alex.

I was under impression that once included at the topmost level, the includes
will be available throughout the next levels.

Regards,
Rad.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu