We have Itemize which does an equate list with sequential numbers and we can jump the number mid list with equate(jump number), but there doesnt seem to be a way to easily create a list of sequential numbers to the power of 2 or squared for long unique bitmasks.
I think its another template I’m going to have to build because that way it can meet the requirements where people like Federico want to see them written out explicitly and I understand those reasons.
For me, I’ve seen websites with incorrect values for use with MS api’s for when people dont have VS or SDK kits which makes me wonder if there is an attack vector in the making. So the template would/should eliminate that potential attack vector and the templates are high up on the reasons why we use Clarion, because the templates help to remove human errors.
Sleep is a luxury when one is poor.
Edit.
Another way to put this is, if I dont ask questions, in a bid to educate myself, I will continue to be exploited and exploitation starts with those teaching lessons.
Just use the column-wise editing ability of your program editor. Keep a file handy that has just the binary sequence of numbers and then do a column copy and paste from that into your program editor, after you have made the list of equate labels. Then use column editing to insert the “EQUATE(” and “)”. “ITEMIZE” may have sounded like a cool thing in the beginning, but with today’s program editing tools, I think “ITEMIZE” is a terrible idea.
I don’t recommend using a prefix on an Itemize’d equate. Because the declaration then won’t show up when you do a source search. In other words searching for
I:One
will show you everywhere it is used, but not where it is declared.
I had a programmer do it this way in some of our libraries, and it made it very difficult to debug the code.
What is made difficult by use of ITEMIZE,PRE(I ) ?
The only thing I can think of is you were searching for the values associated with one of the equates. For example searching for the value of I:PlusOne from BoxSoft’s (Mikes) example above.
So when, your KSS search for I:PlusOne - filtered to declaration rows fails
You search again for PlusOne - easy peasy - same process when search for anything in clarion that might have a prefix (Files, Groups, Queues )
The real question is WHY you’d want to know the value of the ITEMIZE
My guess is you’re showing the value in a debugging statement.
So instead of showing the value, why not show a string interpretation
I just call the ToDescription( LONG xCode ),STRING method from the Enumeration class that I create for each ITEMIZE.
for example:
ctEnumRepeatSpacing CLASS(ctEnumBase),TYPE,MODULE('ctEnumHelpers.clw'),LINK('ctEnumHelpers.clw',_ABCLinkMode_),DLL(_ABCDllMode_)
ToDescription PROCEDURE(LONG xCode ,BYTE BlankOnError=FALSE),STRING,DERIVED
ToCode PROCEDURE(STRING xDescription),STRING,DERIVED !From Description to Code
PropFrom PROCEDURE(LONG xFlag=0 ),STRING,DERIVED
END
The PropFrom is used to for ?SomeList{PROP:From} = oEnumRepeatSpacing.PropFrom()
In truth since these classes have no properties, I should remove the ,TYPE and just call them as static classes.
In my experience, a search for declaration is not so much to know the value, but to know what other possible equates there are in that itemize structure. The value is important too though.
Well Mark, if you’ve got a whole class wrapper dealing with your equates and you have a way to know what a particular value means when you place it into a DEBUG statement or see it in a TPS file then I see you might not need to have explicit equates.
Mark there is a YouTube video that someone did to show column-wise editing. I’m not sure if she demonstrates block mode copy paste, but it is like using the multiple cursors - you can make a whole lot of similar lines of code in little time at all. YouTube video Block Mode / Column Editing Mode