473,414 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

PHP calling TCL proc causes thousands of server errors - HELP

if (!function_exists('proper_case')) {
/**
* Ths function will convert a string into a proper case format using
the customized TCL proc "PROPER_CASE" from the included TCL string
tools libraries
*
* @access public
* @param mixed $text
* @param mixed $tclLibPath Path to TCL Library files
* @param DBActionPerformer $dbAP You must generate a descendant of
MethodGeneratorForActionPerformer to retrieve customized command-line
formatting to call TCL shell
* @return mixed $text properly formatted in Proper Case Form
* @see DBActionPerformer
* @uses tcl_string_tools::PROPER_CASE
*/
function &proper_case($text, $tclLibPath, $dbAP) {
if (!is_object($dbAP)) $dbAP =& new DBActionPerformer(); // NO NEED TO
CONNECT NOR DISCONNECT
list($tclKommand, $tclRedirect) =
@array_values($dbAP->getKommandOSArray('tcl'));
$tclSourceString = tcl_lib_include($tclLibPath);
if ($tclSourceString && !preg_match('/;[\n\r\s\t]*$/i',
$tclSourceString)) $tclSourceString .= ';'; // ADD ";" TO ADD ONE MORE
TCL COMMAND TO THE SINGLE LINE
$tclSourceString = str_replace(';', ";\n", $tclSourceString);
$msg = exec("$tclKommand << ':eof'\n$tclSourceString puts [PROPER_CASE
\{$text}]\n:eof $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg) ||
strcmp(strtolower(trim($msg)), strtolower(trim($text))) != 0) {
trigger_error("Error involving TCL proc \"PROPER_CASE\" on \"$text\":
" . nl2br($msg), E_USER_WARNING); // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}

This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case.. however, upon running it, you get
thousands of these lines:

":eof" No such file or directory

What in the world am I doing wrong?

Thanx
Phil

Mar 13 '06 #1
2 1332
NC
comp.lang.php wrote:

This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case..
And you are not using ucwords() because...
What in the world am I doing wrong?


Not using ucwords(), of course... :) Check it out:

http://www.php.net/ucwords

Cheers,
NC

Mar 13 '06 #2

NC wrote:
comp.lang.php wrote:

This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case..
And you are not using ucwords() because...
What in the world am I doing wrong?


Not using ucwords(), of course... :) Check it out:

http://www.php.net/ucwords

print_r(ucwords('rue de la paix')); // = "Rue De La Paix" which is
wrong, should be "Rue de la Paix"

My TCL proc does this:

puts [PROPER_CASE {rue de la paix}]; # PRINTS "Rue de la Paix"

That's why I want to use my TCL proc and not even ucwords()

Phil
Cheers,
NC


Mar 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: dw | last post by:
Hello all, I'm having a dickens of a time calling a stored procedure on a connection. Every time I do, it generates an error "Arguments are of the wrong type, are out of acceptable range, or are in...
1
by: Skip Key | last post by:
While writing a windows service, I've run into a fairly strange problem. I have a worker proc that gets fired every n seconds using System.Threading.Timer. This works fine, unless I open an...
4
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
1
by: Phil Mc | last post by:
Trying to call a stored proc but some times don't want to have values inserted in some fields. Hi I am rewriting a VBS script which called a stored proc in a SQL server db. The proc takes a...
2
by: satishchandra999 | last post by:
I have SP, which has a cursor iterations. Need to call another SP for every loop iteration of the cursor. The pseudo code is as follows.. Create proc1 as Begin Variable declrations... ...
14
by: krishna1412 | last post by:
Currently i am working in a project of report generation in MS ACCESS. The tables are in sql server 2000. I have to write stored proc in ms access. Illustration: I am having a stored proc...
4
by: Trevor Bishop | last post by:
I'm having problems calling my second proc (MyProcedure2) from within an existing proc. MyProcedure2 does not seeem to fire this way. My code is below. Help appreciated. Thanks, Trevor ALTER...
10
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.