1. ODBC namespace identifier
- Posted by Rad <radhx at rediffmail.com> Dec 07, 2005
- 528 views
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.
2. Re: ODBC namespace identifier
- Posted by Juergen Luethje <j.lue at gmx.de> Dec 07, 2005
- 515 views
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
3. Re: ODBC namespace identifier
- Posted by Alex Chamberlain <alex.chamberlain at tiscali.co.uk> Dec 07, 2005
- 521 views
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
4. Re: ODBC namespace identifier
- Posted by Rad <radhx at rediffmail.com> Dec 08, 2005
- 546 views
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.