Eddie Monster
17th January 2002, 22:23
I am trying use this function server with and getting an error when compiling (Error: Unresolved reference to function 'stpapi.enum.answer'.
Here is the code I'm using:
**********************************
declaration:
#pragma used dll ottstpapihand
choice.print.data:
void stpapi.enum.answer("tdobgpdf","tdobgpdf",1)
***********************************
Where the first "tdobgpdf" is the name of a 3GL (without Stnd. Prgr.) script. The second "tdobgpdf" is a question. and 1 is the enumerated value of the answer I want defaulted.
Any help on this function and using the function server in general would be greatly appreciated. I have already downloaded the AFS (Draft) document from www.support.baan.com, but it didn't really help me.
:confused:
Eddie Monster
18th January 2002, 00:09
Sorry, I did something stupid.
my script has the enumerated value of the 'answer' tdobg.pdf.port, not '1'. and the error I'm getting is this:
Error: Only Constants allowed in subscript.
Eddie Monster
28th January 2002, 17:35
I have the following script that I am just testing...
#pragma used dll ottstpapihand | Baan API handler
|**********************************************
stpapi.enum.answer("tdobgpdf","tdobgpdf",tdobg.pdf.port)
if ask.enum("tdobgpdf",empty) = tdobg.pdf.port then orient = "port"
else
orient = "land"
endif
If I understand correctly, the stpapi.enum.answer should automatically set the answer to my question to tdobg.pdf.port.
Is this correct? I have debugged it and I still get prompted for my question "Do you want to print Landscape or Portrait?".
Any help would be appreciated.
mark_h
28th January 2002, 19:44
Yes - you are correct. It should set the default answer is the sub-session and skip asking the question. Is this part of the conversion to PDF script you set up? It makes wonder if the session in the background is not accepting the stpapi.enum.answer since it is a 3gl script without standard program. Do you mind attaching the script for the session you are calling or email(you have my email address) it to me directly? I would like to see both the FS code and the session it is calling - if you do not mind. I have not yet written a FS to call one of my conversion programs.
Mark
gfasbender
28th January 2002, 19:59
The script code you included has the ask.enum() call in it. Is that what is causing the question to come up?
Your stpapi.enum.answer() call overrides the answer in object "tdobgpdf", not the calling script.
Eddie Monster
28th January 2002, 21:34
Yes, the ask.enum("tdobgpdf",empty) pops up the question "Do you want to print landscape or portrait?".
Are you saying that the stpapi simply triggers a default answer to the question without 'answering' the question?
The script prints a report to PDF format. It uses a third-party software. My scripts sends different command line variables to the third-party software depending on the document's orientation. The question works fine when the print device associated with the script is generated manually by a user. I'm trying to build functionality that allows a batchjob to automatically answer the question.
mark_h
28th January 2002, 23:11
This is my third try at posting a response - so I sent you an email first. But the stpapi.enum.answer defaults the answer in the session that you are calling. The session in the back ground will then process based on the answer you put in the stpapi.enum.answer.
Good Luck!
Mark
popeye
29th January 2002, 19:57
Eddie,
The first argument is the session code.
void stpapi.enum.answer(string session, string question, bset answer)
Hope this helps.