1. 3.0.3 Release Candidate for Windows/DOS
		
		
I've put together a new e30setup.exe file for 3.0.3
You can get it here:
http://www.rapideuphoria.com/uploads/e30setup.exe
I need a few people to test it and let me know
if there are any major blunders, before I move on
to Linux/FreeBSD, and then post an official 3.0.3 release
on the Web site.
Here's what's new.
(At the last minute, I also added double quotes in the install program
to handle file paths with blanks, though that seemed to
work already for almost everyone. I did not fix the
problems that the Translator has with paths containing blanks.)
 Version 3.0.3 May 25, 2007:
 ===========================
 This release adds some new features, fixes some bugs, and improves the
 documentation.
 New Features
 ------------
  * New built-in routines, find_from() and match_from() have been added.
    These work like find() and match() but they let you start searching
    from any element in the sequence, not necessarily at element 1. This
    makes some algorithms simpler and much faster. Implemented by Matthew
    Lewis.
  * When searching for an include file specified with a relative (i.e. not
    absolute) file path, Euphoria will check first for a file relative to
    the location of the current source file. If not found, then the usual
    rules will apply, i.e. it will check relative to the main program file,
    then check the EUINC directories (if any), and finally
    euphoria\include. Suggested by C.K. Lester. Implemented by Matt Lewis.
  * ex int.ex (in euphoria\source) will now work, since the interpreter now
    supports machine_proc(65,...) which passes IL to the fast C-coded
    back-end. You can also run int.ex with exw or exu. This lets you easily
    modify the front end and get a modified Euphoria interpreter, for all
    platforms, that runs programs at full speed (much faster than the
    Euphoria-coded execute.e). You might also bind int.ex to get a single
    executable file for whatever platform you like.
  * If the user does not supply a filename with an extension, Euphoria will
    attempt to open the file first with the standard extension for its
    respective platform, but if it does not find it, it will also look for
    files with the standard extensions for the other platforms. Implemented
    by Matthew Lewis.
  * Translator: The limit on the number of additional .c files that can be
    created per Euphoria file has been raised from 36 to well over 1000.
 New Documentation
 -----------------
  * The "storage cache" compression technique that's used for bound
    executables and .il files, was documented in comments added to
    compress.e. It reduces the size of the IL by 30% or more, while
    allowing fast decompression.
  * A documentation file, tasks.doc, was added to euphoria\demo\langwar. It
    describes the multiple tasks used in Language War.
 Bug Fixes
 ---------
  * bug fixed: Translator: Translated code for routine_id() erroneously
    returned -1 when a global symbol was looked up which matched a symbol
    in the same file as the call to routine_id(), as well as a global
    symbol in another earlier file. It was treated incorrectly as a
    multiply-defined symbol that was lacking a namespace qualifier. Thanks
    to Daniel Kluss.
  * bug fixed: Translator: In rare situations, a naming conflict could
    occur when more than one .c file is created for a Euphoria file. Thanks
    to DB James.
  * bug fixed: Translator: get_key(), when translated/compiled with Borland
    or LCC required an extra keystroke after a carriage return, Thanks to
    Jacques Deschenes.
  * bug fixed: Source Code Portability: euphoria.h: CLK_TCK is now defined
    as CLOCKS_PER_SEC if not defined previously in the source. Implemented
    by Matt Lewis.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		2. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
>   * New built-in routines, find_from() and match_from() have been added.
>     These work like find() and match() but they let you start searching
>     from any element in the sequence, not necessarily at element 1. This
>     makes some algorithms simpler and much faster. Implemented by Matthew
>     Lewis.
Actually, I implemented this enhancement. :)
		
	 
	
		
		3. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> 
>   * When searching for an include file specified with a relative (i.e. not
>     absolute) file path, Euphoria will check first for a file relative to
>     the location of the current source file. If not found, then the usual
>     rules will apply, i.e. it will check relative to the main program file,
>     then check the EUINC directories (if any), and finally
>     euphoria\include. Suggested by C.K. Lester. Implemented by Matt Lewis.
Oops. I meant this one. :)
		
	 
	
		
		4. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
c.k.lester wrote:
> 
> Robert Craig wrote:
> > 
> >   * When searching for an include file specified with a relative (i.e. not
> >     absolute) file path, Euphoria will check first for a file relative to
> >     the location of the current source file. If not found, then the usual
> >     rules will apply, i.e. it will check relative to the main program file,
> >     then check the EUINC directories (if any), and finally
> >     euphoria\include. Suggested by C.K. Lester. Implemented by Matt Lewis.
> 
> Oops. I meant this one. :)
Yeah, I just checked it in.  But I'll take credit until the first bug report 
comes in.  Then it's all yours.
Matt
		
	 
	
		
		5. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
c.k.lester wrote:
> 
> Robert Craig wrote:
> > 
> >   * When searching for an include file specified with a relative (i.e. not
> >     absolute) file path, Euphoria will check first for a file relative to
> >     the location of the current source file. If not found, then the usual
> >     rules will apply, i.e. it will check relative to the main program file,
> >     then check the EUINC directories (if any), and finally
> >     euphoria\include. Suggested by C.K. Lester. Implemented by Matt Lewis.
> 
> Oops. I meant this one. :)
Oops! Sorry. I remember now.
I'll change the credits.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		6. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Matt Lewis wrote:
> c.k.lester wrote:
> 
> Yeah, I just checked it in.  But I'll take credit until the first bug report
> comes in.  Then it's all yours.
I was wondering if I should pipe up for that very reason. XD
		
	 
	
		
		7. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> I've put together a new e30setup.exe file for 3.0.3
> You can get it here:
> <a
> href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
Many thanks to you, Matt and C.K.!
> I need a few people to test it and let me know
> if there are any major blunders, before I move on
> to Linux/FreeBSD, and then post an official 3.0.3 release
> on the Web site.
<snip>
sequence s, x
s = "abcdefghi"
x = "cde"
? match_from(x, s,  4) 
if getc(0) then end if
 
I tested the above code snippet with the EXW interpreter on Windows XP.
It should print 0, but it raises a machine-level exception.
Regards,
   Juergen
		
	 
	
		
		8. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> c.k.lester wrote:
> > 
> > Robert Craig wrote:
> > > 
> > >   * When searching for an include file specified with a relative (i.e. not
> > >     absolute) file path, Euphoria will check first for a file relative to
> > >     the location of the current source file. If not found, then the usual
> > >     rules will apply, i.e. it will check relative to the main program
> > >     file,
> > >     then check the EUINC directories (if any), and finally
> > >     euphoria\include. Suggested by C.K. Lester. Implemented by Matt Lewis.
> > 
> > Oops. I meant this one. :)
> 
> Oops! Sorry. I remember now.
> I'll change the credits.
And it had been _suggested_ in the past by many people.
Regards,
   Juergen
		
	 
	
		
		9. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> I've put together a new e30setup.exe file for 3.0.3
> You can get it here:
> <a
> href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
> 
> I need a few people to test it and let me know
> if there are any major blunders, before I move on
> to Linux/FreeBSD, and then post an official 3.0.3 release
> on the Web site.
> 
> Here's what's new.
<snip>
>   * bug fixed: Translator: get_key(), when translated/compiled with Borland
>     or LCC required an extra keystroke after a carriage return,
I don't have LCC, but at least for Borland there was exactly the same bug 
with wait_key(), which is also "fixed" now. I think this should be documented
in the release notes, too.
I wrote "fixed" in quotes, because the bug fix introduced a new issue:
I translated Euphoria's 'key.ex' with Eu 3.0.2 and Eu 3.0.3, respectively,
and compiled with Borland.
'key.exe' translatd with Eu 3.0.2 shows e.g. the codes for [ESC] and for
function keys, as expected. 'key.exe' translatd with Eu 3.0.3 does not do
so. IMHO this is a bigger disadvantage than the required extra keystroke
after a carriage return.
Regards,
   Juergen
		
	 
	
		
		10. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> 
> Robert Craig wrote:
> 
> > I've put together a new e30setup.exe file for 3.0.3
> > You can get it here:
> > <a
> > href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
> 
> Many thanks to you, Matt and C.K.!
> 
> > I need a few people to test it and let me know
> > if there are any major blunders, before I move on
> > to Linux/FreeBSD, and then post an official 3.0.3 release
> > on the Web site.
> 
> <snip>
> 
> }}}
<eucode>
> sequence s, x
> 
> s = "abcdefghi"
> x = "cde"
> ? match_from(x, s,  4) 
> if getc(0) then end if
> </eucode>
{{{
> I tested the above code snippet with the EXW interpreter on Windows XP.
> It should print 0, but it raises a machine-level exception.
I only did light testing on Matt's new routines.
I guess Matt will have to look into this.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		11. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> 
> Robert Craig wrote:
> 
> > c.k.lester wrote:
> > > 
> > > Robert Craig wrote:
> > > > 
> > > >   * When searching for an include file specified with a relative (i.e.
> > > >   not
> > > >     absolute) file path, Euphoria will check first for a file relative
> > > >     to
> > > >     the location of the current source file. If not found, then the
> > > >     usual
> > > >     rules will apply, i.e. it will check relative to the main program
> > > >     file,
> > > >     then check the EUINC directories (if any), and finally
> > > >     euphoria\include. Suggested by C.K. Lester. Implemented by Matt
> > > >     Lewis.
> > > 
> > > Oops. I meant this one. :)
> > 
> > Oops! Sorry. I remember now.
> > I'll change the credits.
> 
> And it had been _suggested_ in the past by many people.
I'll mention that.
It has been kicked around by various people
over the years.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		12. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> 
> Robert Craig wrote:
> 
> > I've put together a new e30setup.exe file for 3.0.3
> > You can get it here:
> > <a
> > href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
> > 
> > I need a few people to test it and let me know
> > if there are any major blunders, before I move on
> > to Linux/FreeBSD, and then post an official 3.0.3 release
> > on the Web site.
> > 
> > Here's what's new.
> 
> <snip>
> 
> >   * bug fixed: Translator: get_key(), when translated/compiled with Borland
> >     or LCC required an extra keystroke after a carriage return,
> 
> I don't have LCC, but at least for Borland there was exactly the same bug 
> with wait_key(), which is also "fixed" now. I think this should be documented
> in the release notes, too.
> 
> I wrote "fixed" in quotes, because the bug fix introduced a new issue:
> I translated Euphoria's 'key.ex' with Eu 3.0.2 and Eu 3.0.3, respectively,
> and compiled with Borland.
> 'key.exe' translatd with Eu 3.0.2 shows e.g. the codes for [ESC] and for
> function keys, as expected. 'key.exe' translatd with Eu 3.0.3 does not do
> so. IMHO this is a bigger disadvantage than the required extra keystroke
> after a carriage return.
Hmm. I'll take a look at this.
Again, I only lightly tested it.
If necessary, I'll roll back this 2-line change.
Maybe Jacques can see a better solution.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		13. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> 
> Juergen Luethje wrote:
> > }}}
<eucode>
> > sequence s, x
> > 
> > s = "abcdefghi"
> > x = "cde"
> > ? match_from(x, s,  4) 
> > if getc(0) then end if
> > </eucode>
{{{
> > I tested the above code snippet with the EXW interpreter on Windows XP.
> > It should print 0, but it raises a machine-level exception.
> 
> I only did light testing on Matt's new routines.
> I guess Matt will have to look into this.
Apparently, that's all I did, too.  It's a simple change, now committed
to svn:
--- be_runtime.c        (revision 88)
+++ be_runtime.c        (working copy)
@@ -4692,7 +4692,7 @@
     b1 = b->base;
     bp = b1 + c -1;
     a1 = a->base;
-    ntries = lengthb - lengtha + 1;
+    ntries = lengthb - lengtha  - c + 1;
     while (--ntries >= 0) {
        ai = a1;
        bi = bp;
Matt
		
	 
	
		
		14. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Matt Lewis wrote:
> Apparently, that's all I did, too.  It's a simple change, now committed
> to svn:
> 
> --- be_runtime.c        (revision 88)
> +++ be_runtime.c        (working copy)
> @@ -4692,7 +4692,7 @@
>      b1 = b->base;
>      bp = b1 + c -1;
>      a1 = a->base;
> -    ntries = lengthb - lengtha + 1;
> +    ntries = lengthb - lengtha  - c + 1;
>      while (--ntries >= 0) {
>         ai = a1;
>         bi = bp;
OK, great.
I also made a change to euphoria.h to fix a type problem
with the translator and WATCOM.
I've refreshed the release candidate file:
   http://www.rapideuphoria.com/uploads/e30setup.exe
It has your bug fix.
I also removed Jacques bug fix,
and fixed the release note credits for C.K., etc.
I did this fairly quickly.
I hope I didn't mess anything up.
I hope people will check out this new release candidate
for Windows/DOS, and then I can move on to Linux/FreeBSD.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		15. Re: 3.0.3 Release Candidate for Windows/DOS
		
			- Posted by c.k.lester <euphoric at cklester.com>
			May 27, 2007
- 
				Last edited May 28, 2007			
Robert Craig wrote:
> 
> I hope people will check out this new release candidate
> for Windows/DOS, and then I can move on to Linux/FreeBSD.
Rob, when I installed it encountered a backup folder already and asked me if
I wanted to replace each and every file it found. If there was a "Yes to All"
button, that would be useful. :)
		
	 
	
		
		16. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
c.k.lester wrote:
> Robert Craig wrote:
> > 
> > I hope people will check out this new release candidate
> > for Windows/DOS, and then I can move on to Linux/FreeBSD.
> 
> Rob, when I installed it encountered a backup folder already and asked me if
> I wanted to replace each and every file it found. If there was a "Yes to All"
> button, that would be useful. :)
Yes, I'm aware of that. I've seen it myself, and others
have mentioned it, but I don't know how to get the INNO
installer script to handle it better.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		17. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> 
> c.k.lester wrote:
> > Robert Craig wrote:
> > > 
> > > I hope people will check out this new release candidate
> > > for Windows/DOS, and then I can move on to Linux/FreeBSD.
> > 
> > Rob, when I installed it encountered a backup folder already and asked me if
> > I wanted to replace each and every file it found. If there was a "Yes to
> > All"
> > button, that would be useful. :)
> 
> Yes, I'm aware of that. I've seen it myself, and others
> have mentioned it, but I don't know how to get the INNO
> installer script to handle it better.
In the [Files] section entries make sure the "Flags:" do not have
"confirmoverwrite" and do have "ignoreversion" and "overwritereadonly". For
example:
[Files]
Source: "C:\Development\myproj\app.exe"; DestDir: "{app}"; Flags: ignoreversion
overwritereadonly
Source: "C:\Development\myproj\help.txt"; DestDir: "{app}"; Flags: ignoreversion
overwritereadonly
-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell
		
	 
	
		
		18. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Derek Parnell wrote:
> 
> Robert Craig wrote:
> > 
> > c.k.lester wrote:
> > > Robert Craig wrote:
> > > > 
> > > > I hope people will check out this new release candidate
> > > > for Windows/DOS, and then I can move on to Linux/FreeBSD.
> > > 
> > > Rob, when I installed it encountered a backup folder already and asked me
> > > if
> > > I wanted to replace each and every file it found. If there was a "Yes to
> > > All"
> > > button, that would be useful. :)
> > 
> > Yes, I'm aware of that. I've seen it myself, and others
> > have mentioned it, but I don't know how to get the INNO
> > installer script to handle it better.
> 
> In the [Files] section entries make sure the "Flags:" do not have
> "confirmoverwrite"
> and do have "ignoreversion" and "overwritereadonly". For example:
> 
> [Files]
> Source: "C:\Development\myproj\app.exe"; DestDir: "{app}"; Flags:
> ignoreversion
> overwritereadonly
> Source: "C:\Development\myproj\help.txt"; DestDir: "{app}"; Flags:
> ignoreversion
> overwritereadonly
Thanks. 
I know I can quietly overwrite all the files in the euphoria\backup
subdirectory, but that might upset someone who happened to have
a valuable file in there. It would be better to get the person's 
consent before proceeding to clobber all those files.
I'm not sure how to do that easily with INNO using a 
single Yes/No question. Currently I get consent one file at a time, 
which is tedious.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		19. Re: 3.0.3 Release Candidate for Windows/DOS
		
			- Posted by Juergen Luethje <j.lue at gmx.de>
			May 28, 2007
- 
				Last edited May 29, 2007			
Robert Craig wrote:
> Matt Lewis wrote:
> > Apparently, that's all I did, too.  It's a simple change, now committed
> > to svn:
> > 
> > --- be_runtime.c        (revision 88)
> > +++ be_runtime.c        (working copy)
> > @@ -4692,7 +4692,7 @@
> >      b1 = b->base;
> >      bp = b1 + c -1;
> >      a1 = a->base;
> > -    ntries = lengthb - lengtha + 1;
> > +    ntries = lengthb - lengtha  - c + 1;
> >      while (--ntries >= 0) {
> >         ai = a1;
> >         bi = bp;
> 
> OK, great.
> I also made a change to euphoria.h to fix a type problem
> with the translator and WATCOM.
> 
> I've refreshed the release candidate file:
> 
>    <a
>    href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
> 
> It has your bug fix.
> I also removed Jacques bug fix,
> and fixed the release note credits for C.K., etc.
> 
> I did this fairly quickly.
> I hope I didn't mess anything up.
> I hope people will check out this new release candidate
> for Windows/DOS, and then I can move on to Linux/FreeBSD.
Again, I tested with the EXW interpreter on Windows XP.
There is another bug in match_from():
sequence s
object x
s = "abcde"
x = "e"
? match(x, s)
? match_from(x, s, 0)
? match_from(x, s, 1)
? match_from(x, s, 2)
? match_from(x, s, 3)
? match_from(x, s, 4)
? match_from(x, s, 5)
? match_from(x, s, 6)
 
It prints:
5
0
0
0
0
0
0
0
but it should be:
5
5
5
5
5
5
5
0
find_from() and the new include mechanism again worked fine for
me. I didn't test the other changes in Eu 3.0.3.
The next days, unfortunately I'll probably have no time to do
further testing.
Regards,
   Juergen
		
	 
	
		
		20. Re: 3.0.3 Release Candidate for Windows/DOS
		
			- Posted by Matt Lewis <matthewwalkerlewis at gmail.com>
			May 28, 2007
- 
				Last edited May 29, 2007			
Juergen Luethje wrote:
> 
> 
> Again, I tested with the EXW interpreter on Windows XP.
> There is another bug in match_from():
> }}}
<eucode>
> sequence s
> object x
> s = "abcde"
> x = "e"
> 
> ? match(x, s)
> ? match_from(x, s, 0)
> ? match_from(x, s, 1)
> ? match_from(x, s, 2)
> ? match_from(x, s, 3)
> ? match_from(x, s, 4)
> ? match_from(x, s, 5)
> ? match_from(x, s, 6)
> </eucode>
{{{
> 
Thanks for testing this.  I've made the fix to match_from, and committed to
svn.  Another fairly simple bug.
Index: be_runtime.c
===================================================================
--- be_runtime.c        (revision 105)
+++ be_runtime.c        (working copy)
@@ -4691,10 +4691,11 @@
     if (lengthb < c )  // should this be an error?
        return (0);
+
     b1 = b->base;
-    bp = b1 + c -1;
+    bp = b1 + c - 1;
     a1 = a->base;
-    ntries = lengthb - lengtha  - c + 1;
+    ntries = lengthb - lengtha  - c + 2;
     while (--ntries >= 0) {
        ai = a1;
        bi = bp;
Matt
		
	 
	
		
		21. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Matt Lewis wrote:
> Thanks for testing this.  I've made the fix to match_from, and committed to
> svn.  Another fairly simple bug.
> 
> Index: be_runtime.c
> ===================================================================
> --- be_runtime.c        (revision 105)
> +++ be_runtime.c        (working copy)
> @@ -4691,10 +4691,11 @@
> 
>      if (lengthb < c )  // should this be an error?
>         return (0);
> +
>      b1 = b->base;
> -    bp = b1 + c -1;
> +    bp = b1 + c - 1;
>      a1 = a->base;
> -    ntries = lengthb - lengtha  - c + 1;
> +    ntries = lengthb - lengtha  - c + 2;
>      while (--ntries >= 0) {
>         ai = a1;
>         bi = bp;
OK. I picked up your fix and rebuilt everything
for Windows/DOS. The updated install file is in the
same place:
   http://www.rapideuphoria.com/uploads/e30setup.exe
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		22. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
I Juergen,
Strangely I don't get the same result as you. I translated key.ex with euphoria
3.0.2 and Borland compiler and contrary to you I don't get the ESC and function
keys.
Its not really a surprise to me because When using borland or LCC, the backend
use win32api function ReadConsole()
and before calling wingetch() get_key() SetConsoleMode with
ENABLE_PROCESSED_INPUT flag.
The order of call is:
get_key() SetConsoleMode and call wingetch() //in file be_runtime.c
wingetch() call MyReadConsoleChar()
MyReadConsoleChar() call win32api ReadConsole() //in file be_w.c
The problem here is that when the input console buffer is set with the flag
ENABLE_PROCESSED_INPUT
the function keys are processed by the system and not sent to the console input
buffer.
In fact I tested SetConsoleMode(hStdin, 0) and ReadConsole() doesn't return the
function key neither.
-- test code for the Readconsole() behavior
include dll.e
include machine.e
constant kernel32 = open_dll("kernel32.dll")
constant iGetStdHandle = define_c_func(kernel32,"GetStdHandle",{C_UINT},C_UINT)
constant iReadConsole =
define_c_func(kernel32,"ReadConsoleA",{C_POINTER,C_POINTER,C_UINT,C_POINTER,C_POINTER},C_UINT)
constant iSetConsoleMode =
define_c_proc(kernel32,"SetConsoleMode",{C_POINTER,C_UINT})
constant STD_INPUT_HANDLE = -10,  STD_OUTPUT_HANDLE = -11, STD_ERROR_HANDLE =
-12, ENABLE_PROCESSED_INPUT = 1
atom hstdin
  
function MyReadConsoleChar()
object fnVal
atom pBuffer,pNbrRead
  pBuffer = allocate(4)
  pNbrRead = allocate(4)
fnVal =
  c_func(iReadConsole,{hstdin,pBuffer,1,pNbrRead,ENABLE_PROCESSED_INPUT})
  fnVal = peek(pBuffer)
  free(pNbrRead)
  return fnVal  
end function
function wingetch()
integer c
  c=MyReadConsoleChar()
  if c = 0 then return -1 end if
  if c = '\r' then
  --  c = MyReadConsoleChar()
  end if
  return c
end function
integer code
puts(1, "Press any key. I'll show you the key code. Press q to quit\n\n")
hstdin = c_func(iGetStdHandle,{STD_INPUT_HANDLE})
c_proc(iSetConsoleMode,{hstdin,ENABLE_PROCESSED_INPUT})
while 1 do
    code = wingetch() --get_key()
    if code != -1 then
    printf(1, "The key code is: %d\n", code)
    if code = 'q' then
        exit
    end if
    end if
end while
 
CONCLUSION: my bug fix in MyReadConsoleChar() as nothing to  see with this other
bug.
Regards,
Jacques DeschĂȘnes
Juergen Luethje wrote:
> I don't have LCC, but at least for Borland there was exactly the same bug 
> with wait_key(), which is also "fixed" now. I think this should be documented
> in the release notes, too.
> 
> I wrote "fixed" in quotes, because the bug fix introduced a new issue:
> I translated Euphoria's 'key.ex' with Eu 3.0.2 and Eu 3.0.3, respectively,
> and compiled with Borland.
> 'key.exe' translatd with Eu 3.0.2 shows e.g. the codes for [ESC] and for
> function keys, as expected. 'key.exe' translatd with Eu 3.0.3 does not do
> so. IMHO this is a bigger disadvantage than the required extra keystroke
> after a carriage return.
> 
> Regards,
>    Juergen
		
	 
	
		
		23. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Hi Jacques, you wrote:
> I Juergen,
> Strangely I don't get the same result as you. I translated key.ex with
> euphoria
> 3.0.2 and Borland compiler and contrary to you I don't get the ESC and
> function
> keys.
> Its not really a surprise to me because When using borland or LCC, the backend
> use win32api function ReadConsole()
> and before calling wingetch() get_key() SetConsoleMode with
> ENABLE_PROCESSED_INPUT
> flag.
<snip>
After I had translated 'key.ex' with the Eu 3.0.3 Release Candidate and
compiled with Borland, I realized that the program doesn't return a code
e.g. for ESC and the function keys. _For me_ it was a surprise, because
I do not know the internal stuff, and because in the documentation of
get_key() it reads:
| Special codes are returned for the function keys, arrow keys etc.
Neither in the documentation of get_key() nor of wait_key() there is a
comment concerning this issue with Borland and LCC.
Then I tested the same with the current Eu 3.0.2, but probably by mistake
I translated/compiled with Watcom instead of Borland. So it wrongly looked
to me that the same thing worked fine with Eu 3.0.2. I'm sorry.
Regards,
   Juergen
		
	 
	
		
		24. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Robert Craig wrote:
> Matt Lewis wrote:
> > Thanks for testing this.  I've made the fix to match_from, and committed to
> > svn.  Another fairly simple bug.
> > 
> > Index: be_runtime.c
> > ===================================================================
> > --- be_runtime.c        (revision 105)
> > +++ be_runtime.c        (working copy)
> > @@ -4691,10 +4691,11 @@
> > 
> >      if (lengthb < c )  // should this be an error?
> >         return (0);
> > +
> >      b1 = b->base;
> > -    bp = b1 + c -1;
> > +    bp = b1 + c - 1;
> >      a1 = a->base;
> > -    ntries = lengthb - lengtha  - c + 1;
> > +    ntries = lengthb - lengtha  - c + 2;
> >      while (--ntries >= 0) {
> >         ai = a1;
> >         bi = bp;
> 
> OK. I picked up your fix and rebuilt everything
> for Windows/DOS. The updated install file is in the
> same place:
> 
>    <a
>    href="http://www.rapideuphoria.com/uploads/e30setup.exe">http://www.rapideuphoria.com/uploads/e30setup.exe</a>
As far as I can see it works fine now. Thanks!
Regards,
   Juergen
		
	 
	
		
		25. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Hi Rob,
maybe the new release should get version number 3.1 instead of 3.0.3?
When people send a library that uses find_from() or match_from() to the
User Contributions page, they probably want to write a note in the Readme
file such as: "Euphoria 3.0.3 or later required".
I think "3.1" would better express that there is a significant difference
to the previous versions, and so is easier to remember in this context.
Well, just an idea, nothing to write home about.  Regards,
   Juergen
Regards,
   Juergen
		
	 
	
		
		26. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> 
> Hi Rob,
> 
> maybe the new release should get version number 3.1 instead of 3.0.3?
> 
> When people send a library that uses find_from() or match_from() to the
> User Contributions page, they probably want to write a note in the Readme
> file such as: "Euphoria 3.0.3 or later required".
> I think "3.1" would better express that there is a significant difference
> to the previous versions, and so is easier to remember in this context.
> 
> Well, just an idea, nothing to write home about.  > 
> Regards,
>    Juergen
Agreed. Adding _from functions to a program would break backwards compatability.
Feature request - an inbuilt versio() function
Chris
http://euallegro.wikispaces.com
http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html
> 
> Regards,
>    Juergen
Agreed. Adding _from functions to a program would break backwards compatability.
Feature request - an inbuilt versio() function
Chris
http://euallegro.wikispaces.com
http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html
		
	 
	
		
		27. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Hi
Rough draft
integer fp, count, desired_length
sequence buffer
object c
buffer = {}
count = 0
desired_length = 2000
open("Filename.ext", "r"
while 1 do
    c = getc(fp)
    if c = -1 then exit end if  --end of file
    if count > desired_length then exit end if -- desired_length exceeded
    buffer = append(buffer,c)
    count += 1
end while
close(fp)
fp = open("newfile.ext","w")
puts(fp, buffer)
close(fp)
 
Not tested, but I do stuff like that quite frequently. (and may well not be the
most efficient way of doing it)
Chris
http://euallegro.wikispaces.com
http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html
		
	 
	
		
		28. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> maybe the new release should get version number 3.1 instead of 3.0.3?
> 
> When people send a library that uses find_from() or match_from() to the
> User Contributions page, they probably want to write a note in the Readme
> file such as: "Euphoria 3.0.3 or later required".
> I think "3.1" would better express that there is a significant difference
> to the previous versions, and so is easier to remember in this context.
> 
> Well, just an idea, nothing to write home about.  Also, C.K.'s change to the include file search is
significant, and may cause incompatibilities
with prior releases. OK, I'm going to issue a new "3.1"
release candidate in the next day or so.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
Also, C.K.'s change to the include file search is
significant, and may cause incompatibilities
with prior releases. OK, I'm going to issue a new "3.1"
release candidate in the next day or so.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		29. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
Juergen Luethje wrote:
> 
> Hi Jacques, you wrote:
> 
> > I Juergen,
> > Strangely I don't get the same result as you. I translated key.ex with
> > euphoria
> > 3.0.2 and Borland compiler and contrary to you I don't get the ESC and
> > function
> > keys.
> > Its not really a surprise to me because When using borland or LCC, the
> > backend
> > use win32api function ReadConsole()
> > and before calling wingetch() get_key() SetConsoleMode with
> > ENABLE_PROCESSED_INPUT
> > flag.
> 
> <snip>
> 
> After I had translated 'key.ex' with the Eu 3.0.3 Release Candidate and
> compiled with Borland, I realized that the program doesn't return a code
> e.g. for ESC and the function keys. _For me_ it was a surprise, because
> I do not know the internal stuff, and because in the documentation of
> get_key() it reads:
> | Special codes are returned for the function keys, arrow keys etc.
> Neither in the documentation of get_key() nor of wait_key() there is a
> comment concerning this issue with Borland and LCC.
> 
> Then I tested the same with the current Eu 3.0.2, but probably by mistake
> I translated/compiled with Watcom instead of Borland. So it wrongly looked
> to me that the same thing worked fine with Eu 3.0.2. I'm sorry.
I had better look at this more carefully, and probably reinstate
Jacques' bug fix in the next release candidate.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com
		
	 
	
		
		30. Re: 3.0.3 Release Candidate for Windows/DOS
		
		
I've just noticed in the Docs that find_from() and match_from() aren't listed
under "Routines by Application Area" in Part II.
		
	 
	
		
		31. Re: 3.0.3 Release Candidate for Windows/DOS
		
			- Posted by Robert Craig <rds at RapidEuphoria.com>
			May 30, 2007
- 
				Last edited May 31, 2007			
Jules wrote:
> 
> I've just noticed in the Docs that find_from() and match_from() aren't listed
> under "Routines by Application Area" in Part II.
Thanks.
I'll fix that.
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com