Welcome to iraf.net Thursday, May 02 2024 @ 01:02 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Defining a foreign task in the pkgname.cl file.
   
EdAnderson
 07/25/2006 09:08PM (Read 4247 times)  
+----
Newbie

Status: offline


Registered: 02/10/2006
Posts: 8
Mike (or anyone),I'm have a standalone fortran program that is part of a local external package.
Previously, I would define the task in my loginuser.cl file as: task $taskname = $/path-to-executable/executable-nameInside the packagename.cl file I have:cl < "y4kcam$lib/zzsetenv.def"
package y4kcam, bin=y4kbin$task $taskname = $executable-nameThe result of trying to run the task is: "command not found"
If I put: task $taskname = $y4kbin$executable-namethen I get: command not definedWhat is the proper syntax for doing this?thanks,-- Ed

****************************************************************** Ed Anderson, M.Sc. Email: Ed.Anderson@nau.edu Support Systems Analyst, Sr. Phone: (928
 
Profile Email Website
 Quote
fitz
 07/25/2006 09:08PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Ed,Interesting question. In most cases one can get away with simply declaring the task to be "$foreign", but this assumes the unix PATH would find the executable (which is why you get the 'command not found' message). I presume you've got a host command in a package bin directory and want to resolve the path as part of the package loading regardless of the host path? In that case you need to convolve the task declaration as something like (assuming a 'Hello World' task in the IRAF bin directory)[code:1:e2745de29a]
printf ("task $hello = $%s ; keep\n", osfn("bin$hello")) | cl()
[/code:1:e2745de29a]This formats the task statement by resolving the path with osfn(); the 'keep' preserves the declaration in the CL context, and the result is piped to a CL interpreter for processing. A similar trick is used to append e.g. the helpdb string where a simple string concatenation would exceed the CL string length limit. I haven't actually tried this in a package loading script, but don't forsee some reason why it wouldn't work there as well. You could do something similar by creating the path string and using a redirected cl command but while obscure, this is more compact. Let me know if it doesn't work.Cheers,
-Mike

 
Profile Email
 Quote
EdAnderson
 07/25/2006 09:08PM  
+----
Newbie

Status: offline


Registered: 02/10/2006
Posts: 8
Sorry for the delay ... I took a week off.Anyway, I stumbled on the answer ... or one that seems to work.In the packagename.cl file (y4kcam.cl in this case):*******************************package y4kcam, bin=y4kbin
$task $pickbig = "y4kbin$$pickbig"
^^^^^^

Two "$" ... the first dereferences the environment variable (the path
to the executable), the second is the "foreign" definition.*********************************************The faculty member claims that things are working ok now.
-- Ed

****************************************************************** Ed Anderson, M.Sc. Email: Ed.Anderson@nau.edu Support Systems Analyst, Sr. Phone: (928
 
Profile Email Website
 Quote
   
Content generated in: 0.09 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login