BBC BASIC for Windows
« Windows Constants Utility »

Welcome Guest. Please Login or Register.
Nov 21st, 2009, 09:24am




Pages: 1  Reply Notify Send Topic Print
 thread  Author  Topic: Windows Constants Utility  (Read 271 times)
Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Windows Constants Utility
« Thread started on: May 10th, 2009, 08:34am »
Quote

http://tech.groups.yahoo.com/group/bb4w/files/Tools/Add_Ins/WINCONST%20Utility%20Installer.exe

If you had the previous version I would advise uninstalling it first by double clicking on the winconst.exe. This will be uneccessary with future updates as the installer will take care of uninstalling the previous version for you.

Version 1.5 of WINCONST:

- constants are accepted with or without the preceding underscore, but you will *have to* put an underscore in front of constants which start with a Keyword.

- string constants must have a $ postfix.

- You can add a REM!WC directive in your program. Constants will be added just under this if one is present, if not, to the beginning of the program. (If there is more than one directive it will add them to the last one.)

- constants have now been simplified to a value. No more multiple definitions.. you might notice that some negative values are in hex format &F...... as the convertion was performed automatically. You can assume that these values are a mixture of different constants.

- there are still some ommissions in the database as some values (~1,500) did not convert, but scanning through this list most of them are fairly rare constants probably not much used by the BB4W community. However, if you find a constant missing you know the drill.

Michael
User IP Logged

Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Re: Windows Constants Utility
« Reply #1 on: Jul 10th, 2009, 12:26am »
Quote

There are of course omissions and errors in winconst. I am keeping a list of things I have found but if anyone else finds missing constants or mistakes please could they post here.

If anyone gets the urge to translate windows macros then please feel free!

Also, it could be possible to automatically enter a windows structure definition but as Richard has pointed out the winApi definitions are sometimes wrong. Are there any people willing to help add to this utility by typeing out a BB4W verions of (all the/some) structures in the core .ddls? Another way of doing it would be to automatically convert the .h files to a BB4W format. We could have a cenrtal repository for submitting structures.....

Michael

User IP Logged

Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Re: Windows Constants Utility
« Reply #2 on: Jul 10th, 2009, 01:25am »
Quote

frinstance;

FILE_ATTRIBUTE_VIRTUAL = &10000
CB_SETCUEBANNER = &1703

are missing.

I'm sure there are more people would like.

Michael
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 276
xx Re: Windows Constants Utility
« Reply #3 on: Jul 10th, 2009, 09:56am »
Quote

Quote:
if anyone else finds missing constants or mistakes please could they post here

As noted elsewhere on this forum, constants starting with 'TRUE' (e.g. TRUETYPE_FONTTYPE) are not recognised by the utility; you must prefix an (unnecessary) underscore. As I suggested in the other thread, you could use the function below to provide a 'foolproof' test of whether a constant name is valid or not:

Code:
      DEF FNvalid(var$)
      LOCAL dummy%, token$
      dummy% = EVAL("0:" + var$)
      token$ = $(!332+2)
      = (token$ = var$) 

Richard.
User IP Logged

Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Re: Windows Constants Utility
« Reply #4 on: Jul 13th, 2009, 2:59pm »
Quote

FNvalid() is just the ticket but was wondering:

1. Is there a similar TRUE/FALSE function for machine code opcodes eg mov, movzx, etc...

2. Is there a base address for a pointer to a list of keywords? Rather than define my own string (or JR's really) for his FNdetokenise()

Michael
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 276
xx Re: Windows Constants Utility
« Reply #5 on: Jul 13th, 2009, 6:16pm »
Quote

Quote:
Is there a similar TRUE/FALSE function for machine code opcodes eg mov, movzx, etc...

I'm not too sure what you mean by a "similar TRUE/FALSE function". The function I listed determines whether a 'variable' name is invalid, because of starting with (or being) a keyword that would be tokenised. Since assembler opcodes aren't tokenised, you can start variable names with them without causing any problems.

Quote:
Is there a base address for a pointer to a list of keywords?

No. Why does the Windows Constants utility need a list of keywords? It's worth noting that the 'cruncher' - which has to be able to detect all variables within a program so they can be crunched, does not use a list of keywords! It's a feature of BBC BASIC that you can very easily parse a (tokenised) BBC BASIC program to find the variables without needing a list of keywords.

(This assumes there is no assembler code; detecting variables in assembler code is a completely different kettle of fish).

Richard.
User IP Logged

Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Re: Windows Constants Utility
« Reply #6 on: Jul 28th, 2009, 4:03pm »
Quote

I have updated winconst to fix the known bugs. I will keep it back until I have tested it a bit further, so expect it at the end of the week. I will also do a bit on the installer.

I have not yet updated the dictionary for the known missing constants. This will have to wait for a bit longer.

Michael
User IP Logged

Michael Hutton
Full Member
ImageImageImage

member is offline

Avatar




PM

Gender: Male
Posts: 129
xx Re: Windows Constants Utility
« Reply #7 on: Jul 31st, 2009, 04:30am »
Quote

http://tech.groups.yahoo.com/group/bb4w/files/Tools/Add_Ins/WINCONST%20Utility%20Installer.exe

Well, hopefully this resolves the issues mentioned. Now Version 1.6.

I'm off for a surf.

Michael
User IP Logged

Pages: 1  Reply Notify Send Topic Print
« Previous Topic | Next Topic »


New Monthly Ad-Free Plan!

$6.99 Gets 50,000 Ad-Free Pageviews!
| Hookah | Free Shoutboxes |

This Board Hosted For FREE By Conforums ©
Get Your Own Free Message Board!