Typecasting String as TPersistent Datafield

From: Bill Stevens (hajnshj_at_nowhere.com)
Date: 12/31/03


Date: Tue, 30 Dec 2003 23:28:41 -0500

Hello,

Is there anyway to typecast or 'trick' the compiler into accepting a string
as a Persistent TFieldName? I have about 30 values in a stringlist as such,

MYNAME=TableFieldName
MYFON=TableFieldName
.....

The 'Name' section of the stringlist will be used to search through a HTML
document and replace the located name with the Text in the associated table
field (represented in the 'Value' section).

Can I do something anywhere near this;

vName : String

  StringList1.Text := StringReplace(
    StringList1.Text, vName, (StringList2.Values[vName] as
TPersistentField).asString, [rfReplaceAll]);

All I need to do is get the value in the field - no changes or updates.
Hopefully this is a simple syntax question, I'd hate to have to come up with
a entirely different coding mechanism.



Relevant Pages

  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... Big-O notation isn't mathematics per se, it's computer science notation ... "length of the string". ... outrun something compiled and optimized by a good C compiler. ... > either general computing culture or culture outside computing. ...
    (comp.programming)
  • Re: [EGN] Hoisting Loop Invariants (Was: Re: [EGN] Numerical Accuracy)
    ... compiler out there somewhere that did as you claim. ... > the programmer has this knowledge, then the programmer should not use ... >> string in a loop, regardless of the blatant inefficiency of doing so. ...
    (comp.programming)
  • Re: How to convert Infix notation to postfix notation
    ... and make all strings const save where the intent ... function whose contract is to change the string. ... the compiler "just" prevents the string ... try to do using the pointer you get. ...
    (comp.lang.c)
  • Re: PL/I string representations
    ... >> of the language, so it was interesting to me, hopefully it will be to ... I found a workable compiler for Fortran in 1971 (with a bug ... >> The specified length is the minimum, and each time a character ... >> string is assigned to E, the length is stored with it. ...
    (comp.programming)
  • Why C Is Not My Favourite Programming Language
    ... C has no string type. ... compiler take care of the rest. ... Why does any normal language ... the programmer fail. ...
    (comp.lang.c)