Author |
Topic: Windows Constants Utility (Read 271 times) |
|
Michael Hutton
Full Member
  
member is offline


Gender: 
Posts: 129
|
 |
Windows Constants Utility
« Thread started on: May 10th, 2009, 08:34am » |
|
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
|
|
Logged
|
|
|
|
Michael Hutton
Full Member
  
member is offline


Gender: 
Posts: 129
|
 |
Re: Windows Constants Utility
« Reply #1 on: Jul 10th, 2009, 12:26am » |
|
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
|
|
Logged
|
|
|
|
Michael Hutton
Full Member
  
member is offline


Gender: 
Posts: 129
|
 |
Re: Windows Constants Utility
« Reply #2 on: Jul 10th, 2009, 01:25am » |
|
frinstance;
FILE_ATTRIBUTE_VIRTUAL = &10000 CB_SETCUEBANNER = &1703
are missing.
I'm sure there are more people would like.
Michael
|
|
Logged
|
|
|
|
Richard Russell
Administrator
    
member is offline


Gender: 
Posts: 276
|
 |
Re: Windows Constants Utility
« Reply #3 on: Jul 10th, 2009, 09:56am » |
|
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.
|
|
Logged
|
|
|
|
Michael Hutton
Full Member
  
member is offline


Gender: 
Posts: 129
|
 |
Re: Windows Constants Utility
« Reply #4 on: Jul 13th, 2009, 2:59pm » |
|
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
|
|
Logged
|
|
|
|
Richard Russell
Administrator
    
member is offline


Gender: 
Posts: 276
|
 |
Re: Windows Constants Utility
« Reply #5 on: Jul 13th, 2009, 6:16pm » |
|
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.
|
|
Logged
|
|
|
|
Michael Hutton
Full Member
  
member is offline


Gender: 
Posts: 129
|
 |
Re: Windows Constants Utility
« Reply #6 on: Jul 28th, 2009, 4:03pm » |
|
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
|
|
Logged
|
|
|
|
|