1.6. function Ziron_RegisterKeyword(char* name; pointer callback): DWord; stdcall;
Parameter 1: The keyword for the token, should not contain any special characters.
usable letters: a-z, _, 0-9, note the keyword must start with a letter from a-z.
Parameter 2: A pointer to the callback function.
The callback function is declared with no parameters and stdcall.
e.g.
function myCallback() {
Result is a reference ID to the keyword.
because the internal text processor works on byte to byte basis, it would be very slow to have a callback and keyword events based on characters.
This sort of thing would be best to be pre-processed by the plugin using the event "ProgramEntry", Ziron_Execute can be called from this event, but note that you must manually process all of the buffer and then execute it:
3.4. procedure ProgramEntry(char* apptype); stdcall;
This procedure is called if exported when the program has passed declaration type. e.g. "program WIN32DLL 'name';" and Ziron system files.
The parameter is a pointer to a null terminated string containing the app type "WIN32DLL" or such.
Note: that the system.zir file will take priority and be included before this event is called.
not to worry, some of the mmx high level stuff will be added shortly, the problem is that by adding high level for movq and movd is people may forget to call emms before fpu instructions.
please can you give a working example of using programEntry.
i have tryied that but no successful.
procedure ProgramEntry(char* apptype)
{
char tmp[2048];
edi = strGetLine(apptype, @tmp);
while(edi <> 0) {
Ziron_ShowMessage(@tmp);
eax = Ziron_Exec(@tmp);
if (eax == false) {
Ziron_FatalError('Dim plugin is not compatible with this version of Ziron');
return true;
}
edi = strGetLine(edi, @tmp);
}
}