1. euphoria error
- Posted by dcole Apr 28, 2010
- 2517 views
win32lib.ew v0.60.6 Euphoria Interpiter 4.0.0 beta 3 (r3116) for Windows
---------------------------------error------------------------------------------ e:\eu\win32lib\Win32lib.ew:26805 s = ( s = ' ' ) ^ type error ...included by Win32Lib.ew, line 520 ...included by port.exw, line 4 --------------------------------------------------------------------------------Hello everybody, My computer crashed and now I keep getting the above error.
Any help appreciated.
Don Cole
2. Re: euphoria error
- Posted by ChrisB (moderator) Apr 28, 2010
- 2501 views
win32lib.ew v0.60.6 Euphoria Interpiter 4.0.0 beta 3 (r3116) for Windows
---------------------------------error------------------------------------------ e:\eu\win32lib\Win32lib.ew:26805 s = ( s = ' ' ) ^ type error ...included by Win32Lib.ew, line 520 ...included by port.exw, line 4 --------------------------------------------------------------------------------Hello everybody, My computer crashed and now I keep getting the above error.
Any help appreciated.
Don Cole
Hi Don
Not sure what this has to do with your computer crashing, but it looks like the line 's = ( s = ' ' )' is evaluating to TRUE or FALSE, and trying to set s to either of these values is balking at this, unless your crash corrupted win32lib. Look at what variable type s is.
Chris
3. Re: euphoria error
- Posted by SDPringle Apr 28, 2010
- 2540 views
I think you should just reinstall your win32lib.ew files. There is no such line in mine.
What SVN version is that?
I use an svn checkout:
https://win32libex.svn.sourceforge.net/svnroot/win32libex/trunkversion 68.
I had a few problems but nothing like this one.
Shawn Pringle
4. Re: euphoria error
- Posted by petelomax Apr 28, 2010
- 2504 views
- Last edited May 01, 2010
Run Edita/Options/File Extensions and look for exw. If my suspicions are right, it says pw.exe: change it to exw.exe. Edita ships with an old public domain 2.4, or use browse to locate r3116 or whatever.
Regards, Pete
5. Re: euphoria error
- Posted by petelomax Apr 28, 2010
- 2488 views
- Last edited May 01, 2010
* deleted *
6. Re: euphoria error
- Posted by dcole May 01, 2010
- 2293 views
* deleted *
Why was this message deleted? I was in the middle of something here.
7. Re: euphoria error
- Posted by petelomax May 01, 2010
- 2249 views
Why was this message deleted? I was in the middle of something here.
Sorry, I suddenly felt it was out of date, misleading, and inappropriate. I've put a more permanent copy of that text here http://edita.isgreat.org/phpBB2/viewtopic.php?f=1&t=28
8. Re: euphoria error
- Posted by dcole May 01, 2010
- 2287 views
Thank you, Chris, SDPringle and Pete,
I upgraded to win32lib 0.70.4a.
Whin I put the old exw.exe under file extentions in Edita everythings works fine.
When I put "E:\Program Files\edita\pw.exe" I get:
e:\eu\win32lib\win32lib.ew:4421
pText = Text
^ type error
Don Cole
9. Re: euphoria error
- Posted by petelomax May 01, 2010
- 2268 views
oops, managed to duplicate my post instead of editing it, sorry
10. Re: euphoria error
- Posted by petelomax May 01, 2010
- 2241 views
When I put "E:\Program Files\edita\pw.exe" I get:
e:\eu\win32lib\win32lib.ew:4421
pText = Text
^ type error
Don Cole
Looks like you (/Phix) found a minor bug in win32lib.
I see:
4414 global function ansiUpper(sequence Text) -- added R. Stowasser 4415 sequence upperText 4416 atom pText 4417 4418 if sequence(Text) then 4419 pText = w32acquire_mem(0, Text) 4420 else 4421 pText = Text 4422 end if
and slightly earlier:
4392 global function ansiLower(object Text)
obviously ansiUpper's parameter should likewise be object, not sequence
I will try and do some tests on 0.70.4a in a couple of days time.
Regards, Pete
11. Re: euphoria error
- Posted by DerekParnell (admin) May 02, 2010
- 2217 views
Looks like you (/Phix) found a minor bug in win32lib.
... obviously ansiUpper's parameter should likewise be object, not sequence
I've fixed this now in the sourceforge SVN for win32lib.
NOTE: When the parameter is an atom, it is assumed to be the address of a null-terminated string in RAM and not a single character to be converted.
12. Re: euphoria error
- Posted by jimcbrown (admin) May 02, 2010
- 2230 views
Looks like you (/Phix) found a minor bug in win32lib.
... obviously ansiUpper's parameter should likewise be object, not sequence
I've fixed this now in the sourceforge SVN for win32lib.
NOTE: When the parameter is an atom, it is assumed to be the address of a null-terminated string in RAM and not a single character to be converted.
For ASCII, surely a check for (integer(Text) and Text < 256 and Text > -1) is enough to tell if a given atom is a sngle character or a pointer to RAM?
If these functions support UTF-16 then this is not possible, of course...
13. Re: euphoria error
- Posted by DerekParnell (admin) May 02, 2010
- 2193 views
For ASCII, surely a check for (integer(Text) and Text < 256 and Text > -1) is enough to tell if a given atom is a sngle character or a pointer to RAM?
If these functions support UTF-16 then this is not possible, of course...
I'm just reporting what is does do and not what it could do.
14. Re: euphoria error
- Posted by jimcbrown (admin) May 02, 2010
- 2205 views
I'm just reporting what is does do and not what it could do.
That's reasonable. I was just wondering if there was a really good and very important reason for the lack of that capability that I had missed or if it was just something that needed a programmer to code up or etc.
15. Re: euphoria error
- Posted by DerekParnell (admin) May 02, 2010
- 2172 views
I'm just reporting what is does do and not what it could do.
That's reasonable. I was just wondering if there was a really good and very important reason for the lack of that capability that I had missed or if it was just something that needed a programmer to code up or etc.
I don't know. I didn't write the functions nor are they needed in the new Win32Lib.
16. Re: euphoria error
- Posted by dcole May 03, 2010
- 2159 views
Looks like you (/Phix) found a minor bug in win32lib.
... obviously ansiUpper's parameter should likewise be object, not sequence
I've fixed this now in the sourceforge SVN for win32lib.
NOTE: When the parameter is an atom, it is assumed to be the address of a null-terminated string in RAM and not a single character to be converted.
I found several errors like this I will post when I finish.
Don Cole
17. Re: euphoria error
- Posted by dcole May 03, 2010
- 2151 views
Error I found so far:
win32lib.ew line 4622 word should be object
w32resources.ew 3485 global function textToBitmap( sequence s ) s should be object global function textToBitmap( object s )
w32resources.ew 5230 procedure setMousePointer_( object id, atom handle, integer flag) sequence lKids,lCursors should be object lCurors
w32resources.ew 5472 maskbits should be object
w32resources.ew 4064 image should be object
win32lib.ew 9316 id should be object
win32lib.ew 12532 attribs should be object maybe integer
win32lib.ew 18133 line should be object
Don Cole
18. Re: euphoria error
- Posted by petelomax May 03, 2010
- 2194 views
Sorry Don, I disagree with most of these. Have a look at my mods (all marked PL 02/05/10) available at http://uploading.com/files/7mm38ac5/Include.zip
See also http://oe.cowgar.com/forum/111355.wc?last_id=0
I will happily expand on any of these, but one at a time, OK?
win32lib.ew line 4622 word should be object
disagree.
w32resources.ew 3485 global function textToBitmap( sequence s ) s should be object global function textToBitmap( object s )
disagree.
w32resources.ew 5230 procedure setMousePointer_( object id, atom handle, integer flag) sequence lKids,lCursors should be object lCurors
Unlikely to be the right thing to do. lCursors is passed to:
procedure setCursorInternal(integer id,sequence data)
I just put a ?9/0 in place of that lCursors=handle line, since it would have crashed there on RDS Eu every time anyway.
w32resources.ew 5472 maskbits should be object
disagree.
w32resources.ew 4064 image should be object
disagree.
win32lib.ew 9316 id should be object
Probably.
win32lib.ew 12532 attribs should be object maybe integer
Not sure about that one. It is definately used as a sequence, sometimes:
attribs=repeat('i',count)
win32lib.ew 18133 line should be object
agree. (Yeayh! )
19. Re: euphoria error
- Posted by DerekParnell (admin) May 03, 2010
- 2126 views
win32lib.ew line 4622 word should be object
I don't have anything like this in my win32lib.ew. Line 4622 is ...
cts_preallocated += SIZEOF_POINT
which is in
global function ClientToScreen(integer id, integer x, integer y)
w32resources.ew 3485 global function textToBitmap( sequence s ) s should be object global function textToBitmap( object s )
Why? The purpose of the routine is to take a text string, in which SPACE represents a black pixel and NON_SPACE represents a white pixel, and convert that into a monochrome bitmap image. Passing an atom to this routine makes no sense.
w32resources.ew 5230 procedure setMousePointer_( object id, atom handle, integer flag) sequence lKids,lCursors should be object lCurors
Yes, this can cause a crash. However, instead of changing the datatype, which just masks the problem, the routine needs to be written better.
w32resources.ew 5472 maskbits should be object
I don't think so. 'maskBits' needs to be the same datatype as the 'image' parameter, which is a sequence. And that needs to be a sequence as it is a monochrome text 'picture' of a mouse pointer you wish to create.
w32resources.ew 4064 image should be object
I don't think so. 'image' is a set of sequences so must be a sequence. An atom here makes no sense at all.
win32lib.ew 9316 id should be object
Agreed. This is a bug. As it stands, setParent can't be used with ListViews or TreeViews.
win32lib.ew 12532 attribs should be object maybe integer
I don't think so. 'attribs' must be a sequence because it is initialized using the 'repeat()' function whose output is always a sequence. It is supposed to contain zero or more elements, one per item in a ListView.
win32lib.ew 18133 line should be object
I'm not sure which routine you are referring to here, but all the line symbols around this seem to be the correct data type. Why do you think otherwise?
20. Re: euphoria error
- Posted by petelomax May 03, 2010
- 2131 views
win32lib.ew line 4622 word should be object
I don't have anything like this in my win32lib.ew. Line 4622 is ...
cts_preallocated += SIZEOF_POINT
which is in
global function ClientToScreen(integer id, integer x, integer y)
FYI, I believe he is referring to
global function controlStyle(integer id,object flags,integer extended,integer action)
in which my recommendation is
sequence words --(as is) -- kludge: and_bits() only works on integers, not on atoms representing machine integers --PL 02/05/10 --/**/ words=sq_and_bits(w32unpack_dword(oldFlags),w32unpack_dword(flags)) --/* Phix words=and_bits(w32unpack_dword(oldFlags),w32unpack_dword(flags)) -- RDS */
Thanks, I can tick that one off now.
win32lib.ew 12532 attribs should be object maybe integer
I don't think so. 'attribs' must be a sequence because it is initialized using the 'repeat()' function whose output is always a sequence. It is supposed to contain zero or more elements, one per item in a ListView.
The problem line, in procedure handleLV, is
attribs=-2
win32lib.ew 18133 line should be object
I'm not sure which routine you are referring to here, but all the line symbols around this seem to be the correct data type. Why do you think otherwise?
I believe he is referring to
global procedure deleteLine(integer id,integer line)
which I accidentally changed to
global procedure deleteLine(integer id,sequence line)
though I really meant
global procedure deleteLine(integer id,object line)
Regards, Pete
21. Re: euphoria error
- Posted by DerekParnell (admin) May 04, 2010
- 2069 views
... though I really meant ...
Are you talking about the Win32lib used with Euphoria or with 'Phix'?
This is a Euphoria forum.
The use of attribs in handleLV() is a mystery to me. In my opinion, the code that CChris wrote for win32lib is of a poorer quality than should have been allowed in production.
22. Re: euphoria error
- Posted by petelomax May 04, 2010
- 2064 views
Are you talking about the Win32lib used with Euphoria or with 'Phix'?
both
This is a Euphoria forum.
Correct. I already deleted post 5 because it was inappropriate. I have also already created a new thread, http://oe.cowgar.com/forum/111355.wc?last_id=0 which is intended to be solely about win32lib on RDS Eu.
The use of attribs in handleLV() is a mystery to me. In my opinion, the code that CChris wrote for win32lib is of a poorer quality than should have been allowed in production.
agreed
23. Re: euphoria error
- Posted by mattlewis (admin) May 04, 2010
- 2037 views
The use of attribs in handleLV() is a mystery to me. In my opinion, the code that CChris wrote for win32lib is of a poorer quality than should have been allowed in production.
agreed
While I don't disagree with the sentiment, a lot of the ListView stuff (which appears to be what Derek is referring to) was probably originally written by me, back when I little understood win32lib or the Win32API itself. That's not to say that CChris couldn't have messed up my brillant code! :P
Matt