1. euphoria error

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

new topic     » topic index » view message » categorize

2. Re: euphoria error

dcole said...

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

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

3. Re: euphoria error

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/trunk 
version 68.

I had a few problems but nothing like this one.

Shawn Pringle

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

4. Re: euphoria error

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

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

5. Re: euphoria error

* deleted *

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

6. Re: euphoria error

petelomax said...

* deleted *

Why was this message deleted? I was in the middle of something here.

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

7. Re: euphoria error

dcole said...

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

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

8. Re: euphoria error

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

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

9. Re: euphoria error

oops, managed to duplicate my post instead of editing it, sorry

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

10. Re: euphoria error

dcole said...

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

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

11. Re: euphoria error

petelomax said...

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.

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

12. Re: euphoria error

DerekParnell said...
petelomax said...

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...

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

13. Re: euphoria error

jimcbrown said...

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.

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

14. Re: euphoria error

DerekParnell said...

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.

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

15. Re: euphoria error

jimcbrown said...
DerekParnell said...

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.

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

16. Re: euphoria error

DerekParnell said...
petelomax said...

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

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

17. Re: euphoria error

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

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

18. Re: euphoria error

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?

dcole said...

win32lib.ew line 4622 word should be object

disagree.

dcole said...

w32resources.ew 3485 global function textToBitmap( sequence s ) s should be object global function textToBitmap( object s )

disagree.

dcole said...

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.

dcole said...

w32resources.ew 5472 maskbits should be object

disagree.

dcole said...

w32resources.ew 4064 image should be object

disagree.

dcole said...

win32lib.ew 9316 id should be object

Probably.

dcole said...

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) 
dcole said...

win32lib.ew 18133 line should be object

agree. (Yeayh! blink)

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

19. Re: euphoria error

dcole said...

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) 

dcole said...

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.


dcole said...

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.


dcole said...

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.


dcole said...

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.


dcole said...

win32lib.ew 9316 id should be object

Agreed. This is a bug. As it stands, setParent can't be used with ListViews or TreeViews.


dcole said...

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.


dcole said...

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?

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

20. Re: euphoria error

DerekParnell said...
dcole said...

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 */ 




DerekParnell said...

Agreed. This is a bug. As it stands, setParent can't be used with ListViews or TreeViews.

Thanks, I can tick that one off now.

DerekParnell said...
dcole said...

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 
DerekParnell said...
dcole said...

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

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

21. Re: euphoria error

petelomax said...

... 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.

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

22. Re: euphoria error

DerekParnell said...

Are you talking about the Win32lib used with Euphoria or with 'Phix'?

both

DerekParnell said...

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.

DerekParnell said...

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 blink

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

23. Re: euphoria error

petelomax said...
DerekParnell said...

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 blink

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu