Home » Developer & Programmer » Forms » please explain this procedure (forms 6i, winxp)
please explain this procedure [message #305913] Wed, 12 March 2008 05:59 Go to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
the proc is written in this way.

procedure header(wname varchar2) is
xheader varchar2(200);
xdate varchar2(30);
win_width number;
mco_name coname.name%type;
mcent2_name varchar2(100) := name_i('global.cent2_name');
mform_no uttmenu.form_no%type := name_in('global.form_no');
mprog_sl number := to_number(name_in('global.prog_sl'));
mno number := 0;
mprogs varchar2(30) := lower(name_in('global.progs'));
mowner varchar2(100);
begin
begin
mco_name := name_in('global.co_name');
g.co_code := name_in('global.co_code');
select to_char(sysdate,'dd-mon-yyyy') into xdate from dual;


xheader := initcap(rpad(mowner,70)) ||
initcap(rpad(mco_name,75)) || initcap(xdate);

set_window_property(wname,window_state,maximize);
set_window_property(wname,title,xheader);
set_window_property(wname,icon_name,name_in('global.ipath') || 'earth');
g.form_desc := ' ' || rpad(initcap(rtrim(mcent2_name)),50)
|| upper(mform_no);
exception
when others then
g.dummy := g.cent(sqlerrm,1,1);
g.dummy := g.cent(error_text,1,1);
end header;
mno := 0;
begin
select no into mno from appreqd where prog_sl = mprog_sl
and co_code = g.co_code;
exception
when others then
mno := 0;
-- null;
end;
if mno = 0 then
g.app := 0;
else
g.app := 1;
end if;
exception
when others then
-- g.head2 := true;
g.dummy := g.cent(sqlerrm,1,1);
end;

please explain the following wat they do.
1>g.header( ' main ' );
Above is the way how procedure is called. wat do they mean by 'main'?
2>mcent2_name varchar2(100) := name_in('global.cent2_name');
mform_no uttmenu.form_no%type := name_in('global.form_no');
mprog_sl number := to_number(name_in('global.prog_sl'));
mprogs varchar2(30) := lower(name_in('global.progs'));
why the name_in function is used.
3>xheader := initcap(rpad(mowner,70)) ||
initcap(rpad(mco_name,75)) || initcap(xdate);
how this works?
4>set_window_property(wname,icon_name,name_in('global.ipath') || 'earth');
wat do they mean by wname and wat does name_in('global.ipath') || 'earth' this do?
5>g.form_desc := ' ' || rpad(initcap(rtrim(mcent2_name)),50)
|| upper(mform_no);
how does this work?

Thanks in advance
Re: please explain this procedure [message #305950 is a reply to message #305913] Wed, 12 March 2008 06:53 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm sorry, but your message is almost unreadable. The code is unformatted (not that the post itself misses [code] tags, but really IS unformatted) and I'm not in the mood to search what code belongs to what BEGIN-END or IF-THEN-ELSE block.

Also, part with your questions is written the same way - unreadable; I can't see what is the code and what are your own words.

Please, take some time and read the OraFAQ Forum Guide. It will show you how to properly ask a question, how to format it; use punctuation; don't be afraid to split your thoughts into paragraphs in order to improve readability.

Once you do that, I might look at it. In the meantime, you can hope that someone who is less picky than me will see your question and answer it.
Re: please explain this procedure [message #305962 is a reply to message #305913] Wed, 12 March 2008 07:37 Go to previous message
Flash
Messages: 34
Registered: February 2008
Member
My guesses,

1. 'main' is the window name passed to the procedure 'header'

2. Name_in - Returns the value of the indicated variable.
The returned value is in the form of a character string. Hence you can find to_number(name_in('global.prog_sl'));

3. select initcap ( sysdate) from dual will return 12-Mar-08.


initcap(rpad(mowner,70)) ||initcap(rpad(mco_name,75)) || initcap(xdate);

will return NULL since none of the variables are initialized.

4. wname is the Window Name

5. Concatenating two variables, cent2name and form number to give the form a suitable name

Thanks
Flash
Previous Topic: problem in retrievin the value from database to a form
Next Topic: needed reply immediately
Goto Forum:
  


Current Time: Thu Apr 25 04:38:42 CDT 2024