Main Board > Programming

Passing a COM Object to a CMD

<< < (2/2)

Mike King:
There are a couple of ways to handle this.

One option is at the start of the *cmd program, before issuing the ENTER Var$ to get the arguments, issue an ENTER with no arguments.  This will flip the program from a CALL to a PERFORM allowing you to evaluate the value passed.

Mike King:
Just thought I'd take a moment and provide a code example:


--- Code: ---!
! *cmd/showobj
!
  ENTER ! Make the call a Perform
  LOCAL x$ ! Save X$
  ENTER x$
  x$=STP(x$,2)
  LOCAL objid=EVN(x$)
  PRINT "For object:",objid
  PRINT objid'*
  END
--- End code ---

Save the above in *cmd/showobj then you can issue "showobj varname"

Where varname is a variable with the handle to the object.

Navigation

[0] Message Index

[*] Previous page

Go to full version