home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!mswe.dnet.ms.philips.nl!mosterman
- Newsgroups: comp.sys.intel
- Subject: Re: PLM programming query
- Message-ID: <1992Aug28.104119.131015@mswe.dnet.ms.philips.nl>
- From: mosterman@mswe.dnet.ms.philips.nl (Wim Mosterman)
- Date: 28 Aug 92 10:41:19 +0100
- References: <1992Aug26.093356.6125@canon.co.uk>
- Organization: Philips Medical Systems Nederland
- Lines: 58
-
- In article <1992Aug26.093356.6125@canon.co.uk>, chudley@canon.co.uk (Martin Chudley) writes:
- > Apologies for this, it shouldn't be necessary but the PLM manual isn't very
- > helpful on this subject.
- >
- > All I want to do is pass a string to a procedure. At present I'm using the
- > dot operator to pass a string constant in the function call and a based variable
- > to access it inside the procedure, and I get garbage. Can anyone send a few
- > lines of code showing how to do this - maybe I should just fork out for
- > something sensible like a C compiler.
- >
- > Thanks
- >
- > --
- > Martin Chudley (Postmaster)
- >
- > ARPA : chudley@canon.co.uk Voice : +44 483 574325
- > UUCP : ...seismo!mcsun!uknet!canon!chudley Fax : +44 483 574360
-
- For PLM-51 try this one:
-
- /****************************************************************/
- /* procedure which wants a pointer to a CONSTANT string */
- /****************************************************************/
- write_string: PROCEDURE (ptr, type) USING 2 PUBLIC;
- DECLARE type BIT; /* TRUE means ptr points to CONSTANT */
- DECLARE ptr WORD;
- DECLARE string1 BASED ptr (1) BYTE CONSTANT;
- DECLARE string2 BASED ptr (1) BYTE AUXILIARY;
-
- IF (type) THEN DO;
- /* Use string1 for constant type */
- END ELSE DO;
- /* Use string2 for non-constant type */
- END;
- END write_string;
-
- /****************************************************************/
- /* The calls: */
- /****************************************************************/
- DECLARE output_string (80) BYTE AUXILIARY;
-
- CALL write_string(.('any string', 0DH, 0AH, 0), 1);
- CALL write_string(.output_string, 0);
-
- Disclaimer:
- I'm not sure that the syntax is okay everywhere.
- I assembled this from some old sources I made long ago.
-
- Hopefully this helps.
- .-------------------------------..-------------------------------.
- | .--. ,-. ,-. || ,-----.|
- | \ \ / \/ \ || | ||
- | \ \ ,. / \ || | ||
- | \ \/ \/ /\ /\ \ || Wim Mosterman `-----'|
- | \ / `' \ \ || Philips Medical Systems |
- | \ /\ / \ \ || Best, The Netherlands |
- | `-' `-' `--' || mosterma@mmra1.ms.philips.nl |
- `-------------------------------'`-------------------------------'
-