1. win32 stuff
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Nov 10, 1997
- 577 views
- Last edited Nov 11, 1997
Well, I've been working on converting a WIN32 VB include file into a Euphoria include file. The results can be downloaded from http://www.harborside.com/home/x/xseal/euphoria/eu_win32.zip (125k) There's a lot there and I think some of it is out of date, but hopefully someone can find it useful. There's a LOT of constants to play around with. I don't know if the type/structure offsets were calculated correctly though. I guessed at converting the types passed to dll functions too. Whatever. Enjoy. But I have a problem with the include file. Apparently EXW doesn't like very long constant declarations. I get this error: C:\EUPHORIA>exw win32api.e win32api.e:2473 too many lines CTRY_ITALY = 39, -- Italy ^ What can I do about this? BTW, I agree with Jacques Deschene's and Ad Rienks view on programming in Euphoria, and windows programming will be easier once "wrappers" are written. There also needs to be a better way of setting up data structures. Also if anyone has a good header that links functions with dlls, please share! We need more than one callback too. I made a button and checkbox today but couldn't do anything with them. Bye! -- _____ _____ _____ ________ /\ \ /\ \ /\ \ / \ \ / \____\ / \____\ / \____\ / _ \____\ / / ___/_ / /____/ / / ___/_ / / \ |___| / / /\____\ / \ \ / / /\____\ \ \_/ / / \ \/ / ___/_\ \ \ \ \/ / ___/_ \ /____/ \ / /\ \\/\ \ \ \ / /\ \ \ \ \ \ \/ \____\ \ \ \ \ \/ \____\ \ \ \ \ / / \ \____\ \ / / \ \____\ \ / / \ / / \ / / \ / / \ / / \/____/ \ / / \/____/ \/____/xseal at harborside.com\/____/
2. Re: win32 stuff
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Nov 11, 1997
- 576 views
Pete Eberlein writes: > But I have a problem with the include file. Apparently EXW doesn't like > very long constant declarations. I get this error: > C:\EUPHORIA>exw win32api.e > win32api.e:2473 > too many lines > CTRY_ITALY = 39, -- Italy ^ > What can I do about this? Thanks for reporting this. There are restrictions on the number of lines at both the "top level" of a program, and per routine, although you can have as many routines as you like. I guess you've hit the "top-level" limit. I am planning to eliminate all of these restrictions before the 2.0 final release. Maybe even in time for the beta release. For now, you might try putting multiple constant declarations on one line and see if that helps. (It won't help with the 300 statement debugging limit). You might also break up the single huge include file into more manageable subset pieces for various application areas. Regards, Rob Craig Rapid Deployment Software Euphoria page: http://members.aol.com/FilesEu/
3. Re: win32 stuff
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Nov 11, 1997
- 574 views
- Last edited Nov 12, 1997
Pete Eberlein reported a type_check failure on: > global constant test = or_bits(#40000000, #20000) + 1 Pete, you found an actual bug. Thanks for reporting it. It was easy to fix. You'll get the fix in the next release. The bug has been there since v1.4 or earlier. For now, code it as: 1 + or_bits(...) instead of: or_bits(...) + 1 It actually has nothing to do with or_bits(), but rather any expression assigned to a constant where you add 1 (on the right) and the result is not a Euphoria 31-bit integer: -1.07e9 to +1.07e9. Thanks, Rob Craig Rapid Deployment Software
4. Re: win32 stuff
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Nov 11, 1997
- 586 views
- Last edited Nov 12, 1997
Robert Craig wrote: > > Pete Eberlein reported a type_check failure on: > > > global constant test = or_bits(#40000000, #20000) + 1 > > Pete, you found an actual bug. Thanks for reporting it. Finding the bug was easy. I just tried running a 14000-line file of Win32 constants, so there was bound to be one that would break Euphoria. > It was easy to fix. You'll get the fix in the next release. > The bug has been there since v1.4 or earlier. > > For now, code it as: > 1 + or_bits(...) > instead of: > or_bits(...) + 1 Sorry, still doesn't work. --this code-- constant a = #40000000, b = 1 + a --produces this error--- type_check failure, b is -1.33698e+009 --and this code-- constant a = #40000000, b = a + 1 --produces this error-- type_check failure, b is 1.07374e+009 Now that is really strange. > It actually has nothing to do with or_bits(), but rather any > expression assigned to a constant where you add 1 (on the right) > and the result is not a Euphoria 31-bit integer: -1.07e9 to +1.07e9. Why is Euphoria using 31-bit integers? Why not the normal 32-bits? At first I thought you meant 31 bits plus a sign bit, but those 31 bits _do_ include the sign bit. I discovered this in checking the range values: -2^30 to 2^30 equals the range mentioned above. So Euphoria integers are a 30 bit value plus a 31st sign bit. Where is the 32nd bit going? > Thanks, > Rob Craig > Rapid Deployment Software -- _____ _____ _____ ________ /\ \ /\ \ /\ \ / \ \ / \____\ / \____\ / \____\ / _ \____\ / / ___/_ / /____/ / / ___/_ / / \ |___| / / /\____\ / \ \ / / /\____\ \ \_/ / / \ \/ / ___/_\ \ \ \ \/ / ___/_ \ /____/ \ / /\ \\/\ \ \ \ / /\ \ \ \ \ \ \/ \____\ \ \ \ \ \/ \____\ \ \ \ \ / / \ \____\ \ / / \ \____\ \ / / \ / / \ / / \ / / \ / / \/____/ \ / / \/____/ \/____/xseal at harborside.com\/____/
5. Re: win32 stuff
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Nov 12, 1997
- 607 views
Pete Eberlein reported 2 more instances of a type_check bug: > --this code-- > constant > a = #40000000, > b = 1 + a > --produces this error--- > type_check failure, b is -1.33698e+009 > --and this code-- > constant > a = #40000000, > b = a + 1 > --produces this error-- > type_check failure, b is 1.07374e+009 Thanks again for reporting this. The fix that I made yesterday to solve your original type_check bug report, fixes these two cases as well. This bug has been around since v1.0. For now, substitute 1.0 for 1 and it should work. > Why is Euphoria using 31-bit integers? Why not the normal 32- > bits? At > first I thought you meant 31 bits plus a sign bit, but those 31 bits > _do_ include the sign bit. I discovered this in checking the range > values: -2^30 to 2^30 equals the range mentioned above. So > Euphoria > integers are a 30 bit value plus a 31st sign bit. Where is the 32nd > bit going? The 32nd bit tells me whether a value is an integer, or a pointer to something. If it's a pointer, it could be a pointer to a sequence or an 8-byte floating-point number. Regards, Rob Craig Rapid Deployment Software