1. What I'm doing wrong?
- Posted by jesito Sep 28, 2011
- 1185 views
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.
2. Re: What I'm doing wrong?
- Posted by jeremy (admin) Sep 28, 2011
- 1180 views
Are you sure you are running 4.x? What does eui -version show?
Jeremy
3. Re: What I'm doing wrong?
- Posted by jesito Sep 28, 2011
- 1172 views
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.
4. Re: What I'm doing wrong?
- Posted by mattlewis (admin) Sep 28, 2011
- 1143 views
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
5. Re: What I'm doing wrong?
- Posted by useless Sep 28, 2011
- 1085 views
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
6. Re: What I'm doing wrong?
- Posted by mattlewis (admin) Sep 28, 2011
- 1098 views
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
7. Re: What I'm doing wrong?
- Posted by jesito Sep 28, 2011
- 1092 views
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.