I stumbled over error A2181: initializer must be a string
This is the structure that triggers the error:
JSEL STRUCT
chrg CHARRANGE <>
fvl DWORD ?
JSEL ENDS
However, if I change the order, it works:
JSEL STRUCT
fvl DWORD ?
chrg CHARRANGE <> ; as last item, it works
JSEL ENDS
Any explanation?
I'm almost certain the source of the error is somewhere "around" (above?) the declaration of the structure itself. Use the /Fl and /Sa options with ml to investigate.
Both cases work in my tests.
It works for me, and a similar structure defined in windows.inc (Version 1.4c BETA 20 July 2007) also works:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include \masm32\include\masm32rt.inc
JSEL STRUCT
chrg CHARRANGE <>
fvl DWORD ?
JSEL ENDS
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.data
jsel JSEL <>
tr TEXTRANGEA <>
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
mov jsel.chrg.cpMin, 1
mov jsel.chrg.cpMax, 2
mov jsel.fvl, 3
mov tr.chrg.cpMin, 1
mov tr.chrg.cpMax, 2
mov tr.lpstrText, 3
inkey "Press any key to exit..."
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
TEXTRANGEA STRUCT
chrg CHARRANGE <>
lpstrText DWORD ?
TEXTRANGEA ENDS
I found the reason:
js JSEL 10 dup (<?>) throws the error
js JSEL 10 dup (<>) works fine
Thanks to both of you for pushing me into the right direction.