1. What I'm doing wrong?

Hello,

I'm trying to run a program that does include a switch statement. The interpreter flags "switch" as not defined:

    fblength = length(fbuffer) 
    j = k = 1 
    filetable = {} 
    filename = {} 
    for i=1 to fblength do 
        c = onefetch(fbuffer,i) 
        switch c do              
            case '\10' then  
                filetable[j] = filename 
                k = 1 
                filename = {}                 
            case else 
                append (filename[k], c) 
        end switch 
    end for 

And the interpreter says:

C:\$TOOLS\EUPHORIA\PROJECTS\JULIO\0.Prefiltro.exw:109 
switch has not been declared 
        switch c do 
             ^ 

I'm getting mad... Any help would be very appreciated. Thanks in advance. Regards. Jes.

new topic     » topic index » view message » categorize

2. Re: What I'm doing wrong?

Are you sure you are running 4.x? What does eui -version show?

Jeremy

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

3. Re: What I'm doing wrong?

Pretty sure:

C:\Documents and Settings\Administrator>eui -v 
Euphoria Interpreter v4.0.0 
   Windows, Using Managed Memory 
   Revision Date: 2010-12-22, Id: 115714454200 

Even the test program in the manual does fail:

switch x with fallthru do 
2 case 1 then 
3 ? 1 
4 case 2 then 
5 ? 2 
6 break 
7 case else 
8 ? 0 
9 end switch 

C:\$TOOLS\EUPHORIA\PROJECTS\JULIO\testswitch.exw:1 
switch has not been declared 
switch x with fallthru do 
     ^ 
Press Enter 

Might it be a bug? Regards, Jes.

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

4. Re: What I'm doing wrong?

jesito said...

Pretty sure:

C:\Documents and Settings\Administrator>eui -v 
Euphoria Interpreter v4.0.0 
   Windows, Using Managed Memory 
   Revision Date: 2010-12-22, Id: 115714454200 

Are you running from the command line: eui my_app.ex ?

Do you have an older version of euphoria installed and associated with .ex and .exw?

Matt

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

5. Re: What I'm doing wrong?

mattlewis said...
jesito said...

Pretty sure:

C:\Documents and Settings\Administrator>eui -v 
Euphoria Interpreter v4.0.0 
   Windows, Using Managed Memory 
   Revision Date: 2010-12-22, Id: 115714454200 

Are you running from the command line: eui my_app.ex ?

Do you have an older version of euphoria installed and associated with .ex and .exw?

Matt

This is why i never have allowed Euphoria extensions to be associated with anything but TextPad. That way i can do nonsense like this:

@PATH=%PATH%;C:\euphoria40b4-3412\bin;C:\euphoria40b4\include 
@SET EUDIR=C:\euphoria40b4-3412 
@start /b C:\euphoria40b4-3412\bin\eui.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 

That's an older bat file, but i call the bat file, not the exe, so the bat file sets up the environment. However, i hear there's new built-in ways to do that in v4, but i have not tried them.

useless

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

6. Re: What I'm doing wrong?

useless said...

This is why i never have allowed Euphoria extensions to be associated with anything but TextPad. That way i can do nonsense like this:

@PATH=%PATH%;C:\euphoria40b4-3412\bin;C:\euphoria40b4\include 
@SET EUDIR=C:\euphoria40b4-3412 
@start /b C:\euphoria40b4-3412\bin\eui.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 

That's an older bat file, but i call the bat file, not the exe, so the bat file sets up the environment. However, i hear there's new built-in ways to do that in v4, but i have not tried them.

Indeed. What I've done (this is on Linux, so YMMV) is to have 4.0.0, 4.0.1, 4.0.2 and 4.0.3 in their own directories. Then, I have a separate directory where I have made the appropriate symlinks using eui400, eui401, euc400, etc. This directory in in my $PATH. In the directory where the binaries are, I have eu.cfg files that point to the correct std library and whatever else. I typically have something close to the tip of 4.1 development code installed as the default eui in /usr/local.

So I can easily run any of those versions to test things out.

Matt

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

7. Re: What I'm doing wrong?

Bingo!.

I had exw.exe on the path... :( Apologies for such a silly question and thanks for the useful help :)

I have to do a cleanup and a clean install.

Kind regards. Jes.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu