Навигация Назад В начало Вперед
#include imodify.vih

//=========================================================
public objInterface IXFILES;
  property XFCODE : word read write;
  property XFNAME : string[20] read write;
  index FILEBYCODE = XFCODE(unique);
  index FILEBYNAME = XFNAME;
end;

//=========================================================
public vipInterface twXFILES
  implements IXFILES, IModify licensed(free);

//=========================================================
interface twXFILES;

  create view as select * from X$FILES;

  property IXFILES.XFCODE : word
	absolute X$FILES.XF$CODE read write;
  property IXFILES.XFNAME : string[20]
	absolute X$FILES.XF$NAME read write;

  function IModify.doInsert : Word;
	{ Result := insert current X$FILES; }
  implementation IModify.doUpdate abstract;
  implementation IModify.doDelete abstract;
  implementation IModify.doFlush  abstract;

  index IXFILES.FILEBYCODE auto;
  index IXFILES.FILEBYNAME auto;
end.

//=========================================================
interface test;

create view

as select
  *

from
  aaa, x$files
;

//---------------------------------------------------------
screen sc;
<<
>>
end;

//---------------------------------------------------------
handleEvent

cmInit:
{
  #define b vaAddStr(0,'
  #define e ');

  #b																	#e
  #b				script Скрипт1(var param1 : word) : String; 	 #e
  #b																	#e
  #b					objInterface IXFILES; 						 #e
  #b					property XFCODE : word read write; 		#e
  #b					property XFNAME : string[20] read write; 	#e
  #b					index FILEBYCODE = XFCODE(unique); 		#e
  #b					index FILEBYNAME = XFNAME; 				#e
  #b					end; 										#e
  #b																	#e
  #b				begin											 #e
  #b					var ix : ixfiles; 						 #e
  #b					loadvipref(ix, ''twxfiles''); 			 #e
  #b																	#e
  #b					getfirst ix where xfcode = param1; 		#e
  #b					Result := ix.xfname; 						#e
  #b				end.												#e
  #b																	#e

  var handle : longInt;

  handle := vaCompile(0);
  vaFreeSource(0);

  var param   : word;
  var result  : string;

  for (param := 0; param < 5)
  begin
	vaBindParameter(handle, param++);
	vaExecute(handle, result);
	Message(result);
  end;
};

end;
end.