Re: retrieve text field content

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: John Spiegel (jspiegel_at_YETANOTHERSPAMHATERc-comld.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 06:50:11 -0600

Hey Eddy,

You can also use ALINES to break each into its own array element. VFP6
doesn't allow you to specify what character to use to break a string, so I'm
using CHRTRAN to convert it to a CR...

cTest = "A=CUSTOMER,P=P,O=RETAIL,C=USD,N=1"
=ALINES( aVars, CHRTRAN( cTest, ",", CHR(13) ) )
FOR VarCntr = 1 TO ALEN( aVars )
    IF !ISDIGIT( substr( aVars[ VarCntr ], AT("=", aVars[ VarCntr ] ) +
1 ) )
         aVars[VarCntr] = STRTRAN( aVars[VarCntr], "=", "='" ) + "'"
    ENDIF
    &aVars[VarCntr]
ENDFOR

The above also populates a memory variable for each "parameter". Note that
it assumes all parameter values are numeric or character, but hopefully gets
the idea across.

HTH,

John

"Eddy" <Eddy@discussions.microsoft.com> wrote in message
news:43FE55E9-BD60-42BE-AF0A-7D45458FDA05@microsoft.com...
> thanks very much, Jack
> It seem doesn't help on my problem. let me explain briefly.
> In that table(sertype c(10), codeparam c(40)),
> sertype codeparam
> A A=CUSTOMER,P=P,O=RETAIL,C=USD,N=1
> B A=SUPPLIER,P=W,O=WPRICE,C=EU,N=1
> C A=*,O=RETAIL,C=*"
> and so on ....
> User would select one of the service, then
> I have to get the content of field codeparam to find
> what 'A=' is, what 'P=' is, what 'C=' is ;A,P,C,O,N could be nothing.
> for example;
> in service 'A', C=USD,USD is defined as U. S. Dollars in currency
> table.(default currency in service 'A')
> in service 'C', C=*, means no currency defined, allow user to enter
currency
> type.
>
> My problem is how to exactly get the content of each parameter
>
> I am using VFP6, SP4
> Could you give me more advice ?
>
>
> "Jack Jackson" wrote:
>
> > On Wed, 22 Sep 2004 20:09:02 -0700, "Eddy"
> > <Eddy@discussions.microsoft.com> wrote:
> >
> > >Hi,
> > >The content of a text field record some parameters of particular
service,
> > >the content could be
> > >"A=CUSTOMER,P=P,O=RETAIL,C=USD,N=1" or
> > >"A=SUPPLIER,P=W,O=WPRICE,C=EU,N=1" or
> > >"A=*,O=RETAIL,C=*"
> > >What is the simplest way to get each parameter word ?
> > >like : what is A;what is P ......
> >
> > I haven't tried this, but this should get you started:
> >
> > LOCAL nRows, nI, cParm, cValue
> > LOCAL ARRAY aRows[1]
> >
> > nRows = ALINES(aRows, somefield, .T., ',')
> > FOR nI = 1 TO nRows
> > cParm = GETWORDNUM(aRows[nI], 1, '=')
> > cValue = GETWORDNUM(aRows[nI], 2, '=')
> > ...
> > ENDFOR
> >
> >
> >



Relevant Pages

  • Re: Soft-hyphens or breakable points in a string
    ... I specify a table width of 100%, but otherwise no cell dimensions are specified. ... An E-mail address is basically an unbreakable string that must not contain whitespace. ... URL or E-mail address needs to be broken, the break should appear "between elements, after a colon, a slash, a double slash, or the symbol @ but before a period or any other punctuation or symbols". ... If you enter a soft hyphen character, MS Word treats it as yet another graphic character and displayes it in all occasions. ...
    (comp.infosystems.www.authoring.html)
  • Re: OT - GETSYI (was:Re: PHONE error - Invalid specification of node or person. Try again.)
    ... Because this name can include up to 15 characters, the buffer length field in the item descriptor should specify 15. ... access: read only mechanism: by 32- or 64-bit descriptor-fixed-length string descriptor mechanism: by 32-bit descriptor-fixed-length string descriptor Name of the node about which $GETSYI is to return information. ... The nodename argument is the 32-bit address or the 32- or 64-bit address of a character string descriptor pointing to this name string. ...
    (comp.os.vms)
  • Re: Which is better - a char type or a string of length one?
    ... data type but its strings have a terminating zero so C has to ... string of one character needs at least two cells. ... If you just specify a string type, you would need runtime checks to ...
    (comp.lang.misc)
  • Re: sed issue
    ... the log file, it truncates the file after the first line, and I have been ... unable to get it to read past the last character of the first line. ... This seems to be the only instance of the problematic string, but it is in every one of the expect log output files. ... You can also try to specify ...
    (comp.unix.shell)
  • Re: CLisp case sensitivity
    ... You have to specify an external format, ... with (string (code-char #x10000)). ... > character Allegro yet it will return 1 in CLISP and SBCL. ... Cats meow out of angst "Thumbs! ...
    (comp.lang.lisp)