I want define 4 charecter string with macro (automatic increment).
The string character letter and/or number but valid dos file name.
sample: (calling macro 3 times)
file_1:
testmac
file_2:
testmac
file_3:
testmac
Want output:
file_1:
db "0001",0
file_2:
db "0002",0
file_3:
db "0003",0
or any non special character
dd "AAAA"
dd "AAAB"
dd "AAAC"
step 1 not condition. Any unique string possible.
Possible define textequ from $?
this seems to work-
testmac macro
ifndef dddd
dddd=0
endif
dddd=dddd+1
arg catstr <">,%dddd,<">
db arg
EndM
tstproc proc
jmp tstret
file_1:
testmac
file_2:
testmac
file_3:
testmac
tstret:
ret
tstproc endp
thx
Nice work. :clap:
FontDef macro
local fname
ifndef dddd
dddd=0
endif
dddd=dddd+1
arg catstr <">,%dddd,<">
fname:
db 6-@SizeStr(<arg>) dup ("0")
db arg
db ".BMF",0
EndM
if you want leading zeros-
FontDef macro
ifndef dddd
dddd=1000000
endif
dddd=dddd+1
arg catstr <">,@SubStr(%dddd,2),<.BMF">
db arg
EndM
I'm not sure why you defined a local fname other than for documentation?
this is not totaly code my macro.
deleting non relevant code, but fname perchance not delete....
But Next macro problem:
LOGFONT STRUCT
lfHeight DWORD ?
lfWidth DWORD ?
lfEscapement DWORD ?
lfOrientation DWORD ?
lfWeight DWORD ?
lfItalic BYTE ?
lfUnderline BYTE ?
lfStrikeOut BYTE ?
lfCharSet BYTE ?
lfOutPrecision BYTE ?
lfClipPrecision BYTE ?
lfQuality BYTE ?
lfPitchAndFamily BYTE ?
lfFaceName 32 dup(0)
LOGFONT ENDS
FontDef macro p1,p2,p3,p4
ifndef dddd
dddd=0
endif
dddd=dddd+1
arg catstr <">,%dddd,<">
p1 label byte
db 6-@SizeStr(<arg>) dup ("0")
db arg
db ".BMF",0
dd p3 ; character group
LOGFONT {p4,FW_NORMAL,0,0,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,PROOF_QUALITY,VARIABLE_PITCH,FF_SWISS,p2}
Endm
FontProp macro p1,p2
local _prop
org $-sizeof(LOGFONT)
_prop:
org $+LOGFONT.lf&p1
IF TYPE (LOGFONT.lf&p1)=1
db p2
ELSE
dd p2
ENDIF
org _prop +sizeof(LOGFONT)
endm
DefineFont "Arial",12
FontProp Italic,1
FontProp Width 12
error this line
IF TYPE (LOGFONT.lf&p1)=1
idea: define font by default data and size
and next lines define special parameter
DefineFont "Arial",12
FontProp Italic,1
FontProp Width 12
Problem: how to determinate stuct tag type (byte or dword)
work
if (type LOGFONT.lf&p1) eq 1
special thanks