home *** CD-ROM | disk | FTP | other *** search
- {$$3249892600 . }include
-
-
-
- type
- SSTRING=string[254];
- LSTRING=string[10000];
-
- var
- g_progress : integer;
- g_progress_step : integer;
-
- glproc_int1 : integer;
-
- function ShellExecute(handle : integer; var action, what, xx, yy : string; param : integer) : integer;
- external 'SHELL32' name 'ShellExecuteA';
-
-
- function SetCurs(var query : string; var curs : cursor; handle : window_id) : boolean;
- var
- curs_old : cursor;
- flags : short;
-
- begin
- if handle<>0 then
- begin
- if not Get_fcursor(handle, curs_old, flags) then SetCurs := false
- else
- begin
- close_cursor(curs_old);
- if Open_sql_cursor(curs, query) then SetCurs := false
- else
- begin
- if not Set_fcursor(handle, curs, -1) then SetCurs := false
- else
- begin
- Reset_view(handle, -1, RESET_CACHE);
- SetCurs := true;
- end;
- end;
- end;
- end;
- end;
-
- function SetCursEx(var curs : cursor; handle : window_id) : boolean;
- var
- curs_old : cursor;
- flags : short;
-
- begin
- if handle<>0 then
- begin
- if not Get_fcursor(handle, curs_old, flags) then SetCursEx := false
- else
- begin
- if not Set_fcursor(handle, curs, -1) then SetCursEx := false
- else
- begin
- Reset_view(handle, -1, RESET_CACHE);
- close_cursor(curs_old);
- SetCursEx := true;
- end;
- end;
- end;
- end;
-
- procedure StrAppend(var source, s : string);
- begin
- StrInsert(source, s, StrLength(s)+1);
- end;
-
- function GetSekvNext(sekv : string[31]) : integer;
- var
- sql : SSTRING;
- begin
- sql := "SET :>glproc_int1="+sekv+".NEXTVAL";
- if SQL_execute(sql) then GetSekvNext := -1
- else GetSekvNext := glproc_int1;
- end;
-
- function GetSekvLast(sekv : string[31]) : integer;
- var
- sql : SSTRING;
- begin
- sql := "SET :>glproc_int1="+sekv+".CURRVAL";
- if SQL_execute(sql) then GetSekvLast := -1
- else GetSekvLast := glproc_int1;
- end;
-
- function Get_name(f_tit : string[10]; first_name : string[15]; last_name : string[20]; l_tit : string[10]) : string[60];
- var
- parsed : string[60];
-
- begin
- parsed:=f_tit;
-
- if (parsed<>"") and (first_name<>"") then parsed:=parsed+" ";
-
- parsed:=parsed+first_name;
- if (parsed<>"") and (last_name<>"") then parsed:=parsed+" ";
-
- parsed:=parsed+last_name;
- if (parsed<>"") and (l_tit<>"") then parsed:=parsed+" ";
-
- parsed:=parsed+l_tit;
-
- Get_name:=parsed;
- end;
-
- function GetLicNum : integer;
- begin
- #sql SET :>glproc_int1=Ri_getlicnum
- GetLicNum := glproc_int1;
- end;
-
-
- function GetSetFocusNum(h_view : window_id; id : integer; field : string[31]; set : boolean) : integer;
- var
- curnum : trecnum;
- curs : cursor;
- unt : untyped;
-
- begin
- if not Get_fcursor(h_view, curs, nil) then GetSetFocusNum := -1
- else
- begin
- unt := id;
- curnum := Look_up(curs, field, unt);
- if curnum>0 then
- begin
- if set then
- Set_ext_pos(h_view, curnum, -1);
- GetSetFocusNum := curnum;
- end;
- end;
- end;
-
- procedure GoToWebUrl(url : SSTRING);
- begin
- if ShellExecute(GetActWind, "open",url,"",".\0",1) <= 32 then
- MessageBox(nil, "Nepoda°ilo se otev°φt URL adresu!", "Chyba", mb_ok+mb_stop);
- end;
-
- procedure ProgressInit(stepnum : integer; caption : string[255]; text : string[255]);
- begin
- if (not Vi_088.IS_OPEN) and (stepnum<=1000) then
- begin
- g_progress := 0;
- g_progress_step := 1000 div stepnum;
- Vi_088.OPEN(nil);
- Vi_088.CAPTION := caption;
- Vi_088.STRING4.TEXT := text;
- end;
- end;
-
- procedure ProgressStep(caption : string[255]; text : string[255]);
- begin
- g_progress := g_progress+g_progress_step;
- Vi_088.CAPTION := caption;
- Vi_088.STRING4.TEXT := text;
- Vi_088.RESET_VIEW(-1,RESET_CONTROLS);
- Peek_message;
- end;
-
- procedure ProgressDone;
- begin
- Vi_088.CLOSE;
- end;
-