Announcement

Collapse
No announcement yet.

How do I test if an OPTIONAL parameter is present

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    > I've got to start reading Help more thoroughly upon a new release

    The last two releases (8x, 9x) have had lots of new stuff.

    I usually pick up on the 'NEW!' statements and functions Ok, but for the 'IMPROVED!' things I have a heck of a time remembering "hey, that function now has <some new and useful option> ."

    MCM

    Leave a comment:


  • John Thompson
    replied
    Thanks, also. I've got to start reading Help more thoroughly upon a new release. I was still using VARPTR.

    Leave a comment:


  • Michael Mattias
    replied
    ISMISSING()

    (Requires PB/CC 5+ or PB/Win 9+. Compiler version not shown)

    Leave a comment:


  • How do I test if an OPTIONAL parameter is present

    I have a subroutine which contains optional parameters - all or none may be required - none being the default condition.

    Code:
    FUNCTION Getnopsline(OPT infile AS STRING, entryflag AS LONG, infileps AS LONG, terminator AS STRING, trim AS STRING) AS STRING
    What is the correct way I should test whether a parameter is used or not - so far all I get is a "subscript error" if I try to find out whether a parameter is present or not.

    Or do I need to have at least one parameter as a flag?

    Bob
    ___________________________________________
    Later

    Found the answer in another PB Forum :

    Code:
    IF ISMISSING(infile) then
    Last edited by Robert Wallace; 5 Oct 2009, 09:15 AM.
Working...
X