Page 1 of 1

problem in using server routine

Posted: Sun Mar 12, 2006 10:42 am
by loric
Hello,

i'm working on this routine (end,nomeFile_1,nomeFile_2) and i'm experimenting some problems.
My routine has 3 input parameters and it returns only one value (Ans)
I want two of these input parameters (nomeFile_1,nomeFile_2) to be my output parameters too,
and pass them to a job sequence.
The routine is below:

Input argument:
end
Input/output
nomeFile_1
nomeFile_2


MyRoutine = "My Routine"

PathName = 'pathList/file_name'

OpenSeq PathName To FileVar Else
Call DSLogWarn("Cannot open ":PathName, MyRoutine)
End
Loop
ReadSeq FileLine From FileVar
On Error
Call DSLogWarn("Error from ":PathName:" status=":Status(),
MyRoutine)
Exit
End
Then
Begin Case
Case FileLine matches 'pp':'...':end ; nomeFile_1 = FileLine[".",1,1]
Case FileLine matches 'ss':'...':end ; nomeFile_2 = FileLine[".",1,1]
Case @TRUE ; Ans = 'File not fou'
End Case
End Else
Exit ; * at end-of-file
End
Repeat
CloseSeq FileVar

Ans = nomeFile_1:";":nomeFile_2


How can i get the value of the modified input parameters in the job sequence?
Thanks.

Posted: Sun Mar 12, 2006 10:49 am
by ray.wurlod
Assuming you have version 7.5 or later:

Code: Select all

Field(RoutineActivity.$ReturnValue, ";", 1, 1)
and

Code: Select all

Field(RoutineActivity.$ReturnValue, ";", 2, 1)
However, your code isn't doing what you want it to do. The final assignment statement always prevents Ans from being "File not foun". Perhaps that assignment statement should read

Code: Select all

Ans = nomeFile_1 : ";" : nomeFile_2 : ";" : Ans

thanks Ray!

Posted: Wed Mar 15, 2006 6:28 am
by loric
it works! :wink: