我想打电话给一个名为函数characterSelection(SDL_Surface *screen, struct SelectionneNonSelectionne sel)
返回一个void
这是.h
我试图调用的函数:
struct SelectionneNonSelectionne;
void characterSelection(SDL_Surface *screen, struct SelectionneNonSelectionne);
void resetSelection(SDL_Surface *screen, struct SelectionneNonSelectionne);
Run Code Online (Sandbox Code Playgroud)
在我的主要功能上,我试着像这样调用它:
characterSelection(screen, SelectionneNonSelectionne);
Run Code Online (Sandbox Code Playgroud)
编译时,我收到消息:
error: expected primary-expression before ')' token
Run Code Online (Sandbox Code Playgroud)
我做了includes
.我想我错误地呼了第二个论点,我的struct
.但是,我无法在网上找到原因.
你知道我做错了什么吗?
我正在使用Oracle 10g数据库并尝试使用SQL命令运行过程.
create or replace procedure "exam" is
begin
DBMS_OUTPUT.PUT_LINE('Test');
end;
Run Code Online (Sandbox Code Playgroud)
然后单击"运行"按钮.它显示:"程序创建".
当我尝试使用以下方法执行它时:
execute exam;
Run Code Online (Sandbox Code Playgroud)
然后单击"运行"按钮,显示:
ORA-00900: invalid SQL statement
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助.
有谁知道重命名mysql存储过程/函数的语法是什么?或者这甚至在MySQL中得到支持?我一直在谷歌上搜索几分钟......
是否可以将对象函数作为参数传递给过程而不是传递整个对象?
我有一个记录定义,其函数定义为公共类参数,例如:
TMyRecord = record
public
class function New(const a, b: Integer): TMyRecord; static;
function GiveMeAValue(inputValue: integer): Single;
public
a, b: Integer;
end;
Run Code Online (Sandbox Code Playgroud)
该功能可能是这样的:
function TMyRecord.GiveMeAValue(inputValue: Integer): Single;
begin
RESULT := inputValue/(self.a + self.b);
end;
Run Code Online (Sandbox Code Playgroud)
然后我希望定义一个调用类函数的过程,GiveMeAValue
但我不想将它传递给整个记录.我可以做这样的事情,例如:
Procedure DoSomething(var1: Single; var2, var3: Integer, ?TMyRecord.GiveMeAValue?);
begin
var1 = ?TMyRecord.GiveMeAValue?(var2 + var3);
//Do Some Other Stuff
end;
Run Code Online (Sandbox Code Playgroud)
如果是,那么我如何正确地将该函数作为过程参数传递?
我这是我第一次尝试创建程序并执行它.首先,我创建简单的表.表的DB方案在这里:
表名:Ziaci
列:
存储过程只在表中插入数据,我用这个SQL cmd创建了store procudure:
create procedure ziaci_proc(surname_in in varchar2,
firstname_in in varchar2, triedaid_in in number)
is
begin
insert into ziaci (surname, firstname,triedaid) values (surname_in,firstname_in,triedaid_in);
end;
Run Code Online (Sandbox Code Playgroud)
我试着把这个问题称为:
execute ziaci_proc('X','Y',1)
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
ORA-00900无效的SQL语句
PL/SQL Developer IDE中带有红色下划线的执行字.
我测试这个程序,它运作良好.
我只能使用此SQL命令执行此过程:
begin
ziaci_proc('A','B',2);
end;
Run Code Online (Sandbox Code Playgroud)
什么是坏的,谢谢你的帮助.
我必须编写一个过程来保存表中任何sql语句的执行时间.
该程序正在调用 exec measuresqltime('sql statement as string');
我的想法是这样的:
--declarations
timestart NUMBER;
BEGIN
dbms_output.enable;
timestart:=dbms_utility.get_time();
EXECUTE IMMEDIATE sql
COMMIT;
dbms_output.put_line(dbms_utility.get_time()-timestart);
-- save time
Run Code Online (Sandbox Code Playgroud)
但它对我来说对一个SELECT *...
条款不起作用.(我认为sql需要一个INTO订单)
有没有办法在程序中执行任何sql-atatements?
如何删除tcl过程?
一罐
unset
一个变量, interp alias {} myproc {} otherproc
,namespace import -force
.但我没有办法让程序不为人知.
我想知道是否可以实现这样的事情:
procedure waitandcall(time,@MyProcedureOrFunction)
执行我创建的功能或程序?
我不确定它们是否被称为回调.
我最近创建了一个定义如下的过程:
create or replace
PACKAGE
pkg_dml_legal_transactions
AS
PROCEDURE spm_update_court_cost(
p_court_state IN legal_court_cost.state%TYPE,
p_tran_code IN legal_court_cost.transaction_code%TYPE,
p_legal_court IN legal_court_cost.court%TYPE default null,
p_end_date IN legal_court_cost.end_date%TYPE,
p_cost_min IN legal_court_cost.cost_range_min%TYPE,
p_cost_max IN legal_court_cost.cost_range_max%TYPE,
p_bal_min IN legal_court_cost.bal_range_min%TYPE DEFAULT NULL,
p_bal_max IN legal_court_cost.bal_range_max%TYPE DEFAULT NULL);
end pkg_dml_legal_transactions;
Run Code Online (Sandbox Code Playgroud)
当我尝试execute
该过程时,我收到一个错误,指出:
PLS-00306: wrong number or types of arguments in call to 'SPM_UPDATE_COURT_COST'
Run Code Online (Sandbox Code Playgroud)
这是我的execute语句的样子:
execute pkg_dml_legal_transactions.spm_update_court_cost('NJ',1,sysdate,1000,40000);
Run Code Online (Sandbox Code Playgroud)
现在我明白了错误意味着什么,但我想如果参数默认为null然后我可以跳过它们,但显然不是.有没有解决的办法?
如果你看一下FreeAndNil程序的代码,你会看到:
procedure FreeAndNil(var Obj);
var
Temp: TObject;
begin
Temp := TObject(Obj);
Pointer(Obj) := nil;
Temp.Free;
end;
Run Code Online (Sandbox Code Playgroud)
它们分配Nil
给对象引用的原因是什么,只有在它被破坏之后?为什么反之亦然?