Post Reply 
(Solved) PRINT: Unexpected HMS formatting/Unexpected DMS formatting
10-07-2016, 08:19 PM
Post: #3
RE: PRINT: Unexpected HMS formatting/Unexpected DMS formatting
It is actually a flag embedded in the number object itself.

Whichever format was entered, use the ->HMS or HMS-> to set that flag. There is not any calculation that happens - it is purely setting the flag.

Here's the code for those commands if you are curious:

Code:
static THPObj *CallHMS2(THPVarFuncDef const *f, THPObj const **Params, Int NbParams)
{
  HP_Real r; if (!Params[0]->GetReal(&r)) return &HPERBadArguementType;
  r.Flags&= ~FDMSDisplay;
  return THPObj::NewReal(&r);
}
static THPObj *Call2HMS(THPVarFuncDef const *f, THPObj const **Params, Int NbParams)
{
  HP_Real r; if (!Params[0]->GetReal(&r)) return &HPERBadArguementType;
  r.Flags|= FDMSDisplay;
  return THPObj::NewReal(&r);
}

TW

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


Messages In This Thread
RE: PRINT: Unexpected HMS formatting/Unexpected DMS formatting - Tim Wessman - 10-07-2016 08:19 PM



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