Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: ph_setlocals() Doesn’t Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: July 10 2022 at 08:14 | IP Logged Quote GadgetGuy

Dave-

Running 2.2 b3-5 and find that ph_setlocals() does not seem to work. It returns a "Syntax error" every time.

I even copied the example out of the help file and it fails, then simplified it to "ph_setlocals(35)" and that fails.

It's a neat ph command I was not previously aware of and would like to use.

Is this a bug or am I doing something something stupid? :-)   

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: July 10 2022 at 10:36 | IP Logged Quote dhoward

Ken,

Took a look at the function and appears that I did not overload it.

In order for it to work, you must supply a total of 5 values for LOCAL vars 1 thru 5. You can supply any type of value.

If you want to skip setting a value, you must supply a string value containing a single space for the appropriate variable and that
variable set will be skipped.

Examples that work:

ph_setlocal(1,2,3,4,5)

ph_setlocal("Test",1," ","test",0)

The last formula will set LOCAL1 to the string "Test", LOCAL2 to 1, LOCAL3 will be skipped, LOCAL4 will be "test" and LOCAL5 will be 0.

For the next version, I'll look at overloading this function.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: July 10 2022 at 10:59 | IP Logged Quote GadgetGuy

Thanks. It is a nifty function, so I am a happy camper to
know how to use it.

I wondered about having to fill all the VAR slots, but the
ph-help documentation examples only show a few vars, and
the only " " entry is between two other entered vars.



__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum