Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: assigning INPUTRET to a global Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: December 08 2007 at 17:37 | IP Logged Quote jeffw_00


I'm trying to set the value returned from an Input box to a global variable SLEEPINCNT - below is my best guess, but it doesn't work, I think because getsystemvar returns a string.

ph_setglobal_n("SLEEPINCNT",ph_getsystemvar("[INPUTRET]"))

suggestions?
thanks!
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: December 09 2007 at 11:08 | IP Logged Quote BeachBum

I'm no expert, but will this get you closer..

ph_setglobal_a("SLEEPINCNT",integer(ph_getsystemvar("INPUTRE T")))

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 09 2007 at 11:51 | IP Logged Quote dhoward

You can also try this:

ph_setglobal_s("SLEENINCNT","[INPUTRET]")

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


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: December 09 2007 at 11:52 | IP Logged Quote jeffw_00

beachbum's answer is what I was looking for (missed the integer function in my search of the docs).

Dave - I'm sure yours will work too, but I'm guessing only because PH is ok treating a 'string' that's only a number as a "number' later on...

thanks guys
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 09 2007 at 12:36 | IP Logged Quote dhoward

No problem. Keep in mind that ALL variables are actually stored internally as a string (global, local, and temp) and are converted based upon context (in the case of variable substitution) or on-the-fly based upon the ph_get??? function (string, number, time, etc.)

There are two "set" type of functions. The default ph_setglobal_s to set a string and ph_setglobal_a to set ANY valid value. Internally, the ph_setglobal_a will then convert the *any* value to type string and store it in the variable. When it's time to recall the variable, it will be converted to the appropriate type based upon the ph_get??? function.

HTH,

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


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: December 09 2007 at 12:40 | IP Logged Quote jeffw_00

oh, ok - 8-}
thanks
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 

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