FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » missing variable
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: missing variable [message #175846 is a reply to message #175845] Sun, 30 October 2011 23:29 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 10/30/2011 3:57 PM, Denis McMahon wrote:
> On Sun, 30 Oct 2011 08:59:44 -0400, bill wrote:
>
>> if ($ptNum == "empty") return // do nothing, do not need to
>> create an empty appointment, as there is already an identical one
>> $hist = "empty appointment filled ". nowUS() ." by "
>> .$_SESSION['current_user'] . "\n";
>
> No ";" after the preceding "return"
>
> so without the $hist=""; line what you have is:
>
> if ($ptNum == "empty") return $hist = "empty appointment filled ". nowUS
> () ." by " .$_SESSION['current_user'] . "\n";
>
> In other words, the first $hist value after the return is only defined if
> it's being returned from the function, because it comes between the if
> ($ptNum == "empty") and the next ";"
>
> The // only creates comments to the end of line, it doesn't terminate the
> return
>
> So your if statement assigns the $hist value and immediately uses it as
> the return value, when what you want is to assign the value if you didn't
> return.
>
> Rgds
>
> Denis McMahon

Good eye, Dennis. I completely missed that one.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: json and special chars
Next Topic: integer and string what's the difference ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Oct 06 08:21:14 GMT 2024

Total time taken to generate the page: 0.05652 seconds