Post Reply 
variable name characters allowed.
11-16-2017, 05:52 AM
Post: #6
RE: variable name characters allowed.
Hello,
Here is the code that identifies an identifier (var names and the like)

Code:

Int FindEndOfValidIdentifier(wchar_t const *s, wchar_t DecSeparator)
{
  if (DecSeparator==L'\0') DecSeparator= Calc->DecSeparator();
  wchar_t const *S= s;
  if (*s==L'\uE003' || (*s==L'\u03c0' && s[1]<128)) return 1;   // complex i, pi with non unicode after...
  if ((*s<L'A' || (*s>L'Z' && *s<=L'_') || (*s>L'z' && *s<128) || *s==L'\u25b6') && *s!=L'%') return 0; s++;
  while (((*s>=L'A' && *s<=L'Z') || *s==L'_' || (*s>=L'a' && *s<=L'z') || (*s>=L'0' && *s<=L'9') || *s>=128) &&   // In 7 bit ascii, only allows 0-9, A-Z, a-z. 
          !(*s==L'\u25B6' || *s==L'\uE004' ||                                                                     // Above 128, disable, Sto -1    
            *s==L'\u2212' || *s==L'\u00b2' || *s==L'\u221a' || *s==L'\u2264' || *s==L'\u2260' || *s==L'\u2265'))  // neg(-) ° sqrt <= # >= 
    s++;
  return s-S;
}

Cyrille[/code]

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: variable name characters allowed. - cyrille de brébisson - 11-16-2017 05:52 AM



User(s) browsing this thread: 1 Guest(s)