![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
At TCL, type " test it's showtime " and you will get error: [2] Uneven number of delimiters (' " \). It's perfectly logical, there for a purpose, and we wouldn't want to get rid of it. However, these days I'm using TCL as a processor for external requests where we may not have matched quotes. For example, I'm allowing mobile phones to send/receive SMS and email to other applications and devices through D3 using a command like "email abc (AT) def (DOT) tld Subject Text". That's passed from the remote program or device as a TCL command like: WEB.SMS email abc (AT) def (DOT) tld Subject Text. I use TCLREAD or SENTENCE() to get the command line and parse it. But if the command has a mismatched quote, my program doesn't execute because the TCL processor considers the command line invalid before it even gets to the verb. One solution would be to ensure that all commands are wrapped in quotes, as in WEB.SMS "it's showtime". But that requires changing the calling routine, which I can do, but then I'd also need to get my WEB.SMS or any other processor to strip off the leading/trailing quotes. That solution further requires ensuring on the client side that the user query doesn't already include single quotes, double quotes, or backslashes. I would need to escape/replace those characters and then unescape the input in my D3 programs. I really don't like that, but unless I get another suggestion I'll have to go with this. Just for this usage I'd rather have D3 disable its check for matching quotes. That feature is there for AQL query processing, but this is not AQL. Can we disable that check? Does anyone have another suggestion? Does anyone see special elegance in one solution over another? Thanks! T |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I should not execute a command like this at TCL: MY.CMD ARG1 'ARG2 "ARG3 \ARG4 (unclosed.paren I should execute MY.CMD, then use INPUT to get the application-specific argument string, rather than parsing results from SENTENCE() or TCLREAD. I can check for SYSTEM(14) to make sure there is some input, and to avoid a having a process hung waiting when there is no input. Yeah, using the 'standard input' data stream instead of command line args is |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
At the risk of answering my own question, just writing out a definition of the problem seems to have been an inspiring catharsis... I think the solution here is that the TCL command line is a program dedicated to the processing of specific kinds of input. *Rather than subverting that purpose I should simply execute another program that parses input and pass that input to the proper processors. *The simple solution is therefore something like this: I should not execute a command like this at TCL: *MY.CMD ARG1 'ARG2 "ARG3 \ARG4 (unclosed.paren I should execute MY.CMD, then use INPUT to get the application-specific argument string, rather than parsing results from SENTENCE() or TCLREAD. *I can check for SYSTEM(14) to make sure there is some input, and to avoid a having a process hung waiting when there is no input. The above requires a number of changes in different places but I'll write off the time as an enhancement over an originally faulty implementation. *Once the work is done I don't think I'll need to revisit it too often. *The way it is now I'm going to have the same problem in any MV DBMS and with different connectivity methods. Any other thoughts? Thanks again, T Tony Gravagno wrote: At TCL, type " test it's showtime " and you will get error: [2] Uneven number of delimiters (' " \). It's perfectly logical, there for a purpose, and we wouldn't want to get rid of it. However, these days I'm using TCL as a processor for external requests where we may not have matched quotes. For example, I'm allowing mobile phones to send/receive SMS and email to other applications and devices through D3 using a command like "email a... (AT) def (DOT) tld Subject Text". That's passed from the remote program or device as a TCL command like: WEB.SMS email a... (AT) def (DOT) tld Subject Text. I use TCLREAD or SENTENCE() to get the command line and parse it. But if the command has a mismatched quote, my program doesn't execute because the TCL processor considers the command line invalid before it even gets to the verb. One solution would be to ensure that all commands are wrapped in quotes, as in WEB.SMS "it's showtime". But that requires changing the calling routine, which I can do, but then I'd also need to get my WEB.SMS or any other processor to strip off the leading/trailing quotes. That solution further requires ensuring on the client side that the user query doesn't already include single quotes, double quotes, or backslashes. I would need to escape/replace those characters and then unescape the input in my D3 programs. I really don't like that, but unless I get another suggestion I'll have to go with this. Just for this usage I'd rather have D3 disable its check for matching quotes. That feature is there for AQL query processing, but this is not AQL. Can we disable that check? Does anyone have another suggestion? Does anyone see special elegance in one solution over another? Thanks! T |
#7
| |||
| |||
|
|
At TCL, type " test it's showtime " and you will get error: [2] Uneven number of delimiters (' " \). It's perfectly logical, there for a purpose, and we wouldn't want to get rid of it. However, these days I'm using TCL as a processor for external requests where we may not have matched quotes. For example, I'm allowing mobile phones to send/receive SMS and email to other applications and devices through D3 using a command like "email a... (AT) def (DOT) tld Subject Text". That's passed from the remote program or device as a TCL command like: WEB.SMS email a... (AT) def (DOT) tld Subject Text. I use TCLREAD or SENTENCE() to get the command line and parse it. But if the command has a mismatched quote, my program doesn't execute because the TCL processor considers the command line invalid before it even gets to the verb. One solution would be to ensure that all commands are wrapped in quotes, as in WEB.SMS "it's showtime". But that requires changing the calling routine, which I can do, but then I'd also need to get my WEB.SMS or any other processor to strip off the leading/trailing quotes. That solution further requires ensuring on the client side that the user query doesn't already include single quotes, double quotes, or backslashes. I would need to escape/replace those characters and then unescape the input in my D3 programs. I really don't like that, but unless I get another suggestion I'll have to go with this. Just for this usage I'd rather have D3 disable its check for matching quotes. That feature is there for AQL query processing, but this is not AQL. Can we disable that check? Does anyone have another suggestion? Does anyone see special elegance in one solution over another? Thanks! T |
#8
| |||
| |||
|
|
you could use the 'MX' conversion code to pass the argument as character hex. Then there's no issues with quoting or control characters. |
![]() |
| Thread Tools | |
| Display Modes | |
| |