No announcement yet.

Picky syntax question

  • Filter
  • Time
  • Show
Clear All
new posts

  • Picky syntax question

    I searched but couldn't find exactly what I was looking for. I normally wouldn't be so detailed about this question, but I'm having to write a regular expression to tag routines in PB with my editor. What I want to make sure of is the exact requirements for Function, Sub, Method, and Property names.

    1) First, I'm assuming the naming requirements for Function Sub Method and Property are the same, correct?

    2) The docs say that the first character of the name must be alphabetic. Yes, that's pretty clear - but I want to make sure that _ or $ or no other character is allowed. I've never used it, but I would have thought something like "function $X" or "sub _Y" would have been legal. Is it really alpha [A-Za-z] only?

    3) I know that a type specifier can be appended. As far as I can tell, the list of valid type specifiers is [%&?!#@$]. Correct, or did I miss some? (note that I realize the type specifiers can appear multiple times, as in "sub mysub&&&")

    4) As for all chars between the 1st and (possible but not required) type specifier(s), I know that [A-Za-z0-9_] are all valid. Are any other chars valid? For example, can type specifiers appear in the middle of a function name (as in "My$Function$")? Are there any other valid characters that can appear in the middle part of a name?

    Oh, and do the same rules for names also apply to the names of Type, Union, Class, Interface, Macro, Macro Function, and Declare?

    Last edited by Jay Terry; 2 Jul 2009, 03:15 AM.

  • #2
    1. Yes
    2. Yes, it's always been A-z only
    3. Look at the data types topic in the help file
    4. Yes, A-z 0-9 and "_" (underscore) may appear in function names. A number may only appear after a letter.
    5. See 1)
    Last edited by Kev Peel; 2 Jul 2009, 04:49 AM. | Slam DBMS | PrpT Control | Other Downloads | Contact Me


    • #3
      Thank you