can anyone help me writing and calling a function with some parameters. here's wht i know
DEFINE FUNCTION fname(par1,par2)
....
...can i use it with some where clause using master file and return something
END
how can i call fname? to print the returned value.
Thanks Pete,
I think I have to figure out some other way. I have to access same MAS file for different where conditions and with same parameter values. so i thought I can use a function.
Thanks again for ur time
-P
Sounds like you may want to use Dialogue Manager. DM can alter code based on different conditions. For example, a menu with & variables can be used to tell DM how to build code for a TABLE.
I don't remember developer studio dealing much with DM code, but you can insert the code yourself. You probably need to get a Focus manual. A simple example would be; if &REQUEST is 'A', I want to report on FIELD1. Otherwise, I want to use FIELD2. So...
TABLE FILE SAMEFILE
-SET &WORK=IF &REQUEST IS 'A' THEN 'FIELD1' ELSE 'FIELD2';
SUM &WORK
END
DM code can put intelligence into an application, but it can also get very complicated and extensive. It can READ, WRITE, DECODE, IF-THEN-ELSE, GOTO, call functions, default values, etc. That's why you need a manual.
DEFINE FUNCTION WAYMD(INDATE/I8,ADD/I8,FMT/A2)
D01/A3=DOWK(INDATE,'A3');
D02/I8=AYMD(INDATE,ADD,'I8');
D03/I8=IF (D01 NE ' ') AND (D02 EQ 0) THEN 20031231 ELSE D02;
D04/A8=EDIT(D03);
D05/A8=IF FMT EQ 'I6' THEN EDIT(D04,'$$999999') ELSE D04;
WAYMD/I8=EDIT(D05);
END
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.