1. C has not been declared!

Hi,

I am trying to make a small program to dispalay an image onto the screen, but
when I run it, it doesn't show the image and the ERR file says:

    C:\euphoria\BIN\Stuff\ex.err:1
    C has not been declared
    C:\euphoria\BIN\Stuff\ex.err:1
    ^
my code is:
include graphics.e
include image.e

atom gm
sequence graphic1

gm = graphics_mode(18)
clear_screen()
graphic1 = read_bitmap("1.bmp")
display_image({40,20},{graphic1[2]})


Any ideas why it doesn't work?

new topic     » topic index » view message » categorize

2. Re: C has not been declared!

Vidi wrote:

> I am trying to make a small program to dispalay an image onto the screen, but
> when I run it, it doesn't show the image and the ERR file says:
> 
>     C:\euphoria\BIN\Stuff\ex.err:1
>     C has not been declared
>     C:\euphoria\BIN\Stuff\ex.err:1
>     ^
> my code is:
> }}}
<eucode>
> include graphics.e
> include image.e
> 
> atom gm
> sequence graphic1
> 
> gm = graphics_mode(18)
> clear_screen()
> graphic1 = read_bitmap("1.bmp")
> display_image({40,20},{graphic1[2]})
> </eucode>
{{{

> 
> Any ideas why it doesn't work?

I have no idea how this code can produce that error message!
However,
    display_image({40,20}, graphic1[2])
should work.

Regards,
   Juergen

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

3. Re: C has not been declared!

Juergen Luethje wrote:
> 
> Vidi wrote:
> 
> > I am trying to make a small program to dispalay an image onto the screen,
> > but
> > when I run it, it doesn't show the image and the ERR file says:
> > 
> >     C:\euphoria\BIN\Stuff\ex.err:1
> >     C has not been declared
> >     C:\euphoria\BIN\Stuff\ex.err:1
> >     ^
> > my code is:
> > }}}
<eucode>
> > include graphics.e
> > include image.e
> > 
> > atom gm
> > sequence graphic1
> > 
> > gm = graphics_mode(18)
> > clear_screen()
> > graphic1 = read_bitmap("1.bmp")
> > display_image({40,20},{graphic1[2]})
> > </eucode>
{{{

> > 
> > Any ideas why it doesn't work?
> 
> I have no idea how this code can produce that error message!
> However,
>     display_image({40,20}, graphic1[2])
> should work.
> 
> Regards,
>    Juergen

My guess is somehow you are trying to execute the ex.err file instead of your
program? Looking at the output it looks like ex.err is somehow trying to read
itself.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

4. Re: C has not been declared!

> Any ideas why it doesn't work?

Are you using ed? It looks like you're trying to execute the ex.err
file. Close the ex.err file by hitting Esc-Q, then hit Esc-E to run
your app. This is probably a case of mistaken window.

~Greg

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

5. Re: C has not been declared!

Hi again,

the error output should be:

   C:\euphoria\BIN\Stuff\ex.err:1
   C has not been declared
   C:\euphoria\BIN\Stuff\outputs1.ex:17
   ^

sorry for the mistake.  Anyway line 17 is:
graphic1 = read_bitmap("1.bmp")

maybe I should start with something simpler.

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

6. Re: C has not been declared!

Vidi wrote:
> 
> Hi,
> 
> I am trying to make a small program to dispalay an image onto the screen, but
> when I run it, it doesn't show the image and the ERR file says:
> 
>     C:\euphoria\BIN\Stuff\ex.err:1
>     C has not been declared
>     C:\euphoria\BIN\Stuff\ex.err:1
>     ^
> my code is:
> }}}
<eucode>
> include graphics.e
> include image.e
> 
> atom gm
> sequence graphic1
> 
> gm = graphics_mode(18)
> clear_screen()
> graphic1 = read_bitmap("1.bmp")
> display_image({40,20},{graphic1[2]})
> </eucode>
{{{

> 
> Any ideas why it doesn't work?

Hi Vidi,

Your code works fine for me, if I change this line:

display_image({40,20},graphic1[2]) -- see just graphic1[2] without {}


But I can not reproduce that trick with err.ex anyway!

Regards,
Igor Kachan
kinz at peterlink.ru

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

7. Re: C has not been declared!

Vidi wrote:
> 
> Hi again,
> 
> the error output should be:
> 
>    C:\euphoria\BIN\Stuff\ex.err:1
>    C has not been declared
>    C:\euphoria\BIN\Stuff\outputs1.ex:17
>    ^
> 
> sorry for the mistake.  Anyway line 17 is:
> }}}
<eucode>graphic1 = read_bitmap("1.bmp")</eucode>
{{{

> maybe I should start with something simpler.

Hi there,


I can only guess, but it looks like maybe you wanted to include something
like:

  include C:\euphoria\BIN\Stuff\MyFile.e

and instead you typed:

  C:\euphoria\BIN\Stuff\MyFile.e

in which case i think you would get an error saying that 'C' wasnt
declared because Eu thinks it's a namespace prefix.

Just a guess...

See if you have anything like that in one of your files.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

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

8. Re: C has not been declared!

Al Getz wrote:
> 
> Vidi wrote:
> > 
> > Hi again,
> > 
> > the error output should be:
> > 
> >    C:\euphoria\BIN\Stuff\ex.err:1
> >    C has not been declared
> >    C:\euphoria\BIN\Stuff\outputs1.ex:17
> >    ^
> > 
> > sorry for the mistake.  Anyway line 17 is:
> > }}}
<eucode>graphic1 = read_bitmap("1.bmp")</eucode>
{{{

> > maybe I should start with something simpler.
> 
> Hi there,
> 
> 
> I can only guess, but it looks like maybe you wanted to include something
> like:
> 
>   include C:\euphoria\BIN\Stuff\MyFile.e
> 
> and instead you typed:
> 
>   C:\euphoria\BIN\Stuff\MyFile.e
> 
> in which case i think you would get an error saying that 'C' wasnt
> declared because Eu thinks it's a namespace prefix.
> 
> Just a guess...
> 
> See if you have anything like that in one of your files.
> 
> 
> Al
> 
> 
> My bumper sticker: "I brake for LED's"
> 
>  From "Black Knight":
> "I can live with losing the good fight,
>  but i can not live without fighting it".
> "Well on second thought, maybe not."

Hi again,

Ok, i just verified that that would cause that error message and
here's what i got:

C:\Euphoria\TestOthers\Other\UnusualError.exw:1
C has not been declared
C:\download\MyFile.e
^

The file was "UnusualError.exw" and
the only thing in the file was this:
--------------------------------------------
C:\download\MyFile.e
--------------------------------------------

exactly as shown without any 'include' keyword.


You'll have to check your files for any mistake like this.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

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

9. Re: C has not been declared!

Hi again,

I got it working!! yay!! But I don't know how I did it :(
still thanks for all you help.

  --Vidi

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

Search



Quick Links

User menu

Not signed in.

Misc Menu