Announcement

Collapse
No announcement yet.

How do I test if an OPTIONAL parameter is present

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

  • 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.

  • #2
    ISMISSING()

    (Requires PB/CC 5+ or PB/Win 9+. Compiler version not shown)
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Thanks, also. I've got to start reading Help more thoroughly upon a new release. I was still using VARPTR.
      LOCAL MyEMail AS STRING
      MyEmail = STRREVERSE$("53pmohtj") & CHR$(64) & STRREVERSE$("liamg") & CHR$(46) & STRREVERSE$("moc")

      Comment


      • #4
        > 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
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment

        Working...
        X