Jump to content

tedit boolean value

- - - - -

  • Please log in to reply
12 replies to this topic

#1
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Hi,

I like write Tedit descendant who not return result as Text (AnsiString) but return result as
boolean expression for example (I > J)...
How can I do this or where can are I find this TEdit ?

Thank very much.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Can you clarify what you're looking for here?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Ok, so if I'm interpreting this correctly, you want the TEdit object to evaluate a Boolean expression typed into it and return the result?
sudo rm -rf /

#4
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Yes exact.

By.

#5
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Is it going to be able to evaluate variables in your program, or just numeric constants?
sudo rm -rf /

#6
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
to evaluate variables in my program in run-time

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Uh...all I can say is "good luck." That may be possible in scripted languages, but you're going to have to map all of your variables onto strings in a map, find these variables in the map, evaluate them, write them back...
sudo rm -rf /

#8
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Thaknkx I try it may be.

#9
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
#include <map>

std::map<const char*, int*> int_vars;

int a, b, c;
int_vars["a"] = &a;
int_vars["b"] = &b;
int_vars["c"] = &c;

// Now parse the text and match the variable names to their values

sudo rm -rf /

#10
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Thank very much fo help.

#11
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
No problem. If you have any more questions, I'll be around.
sudo rm -rf /

#12
jaiii

jaiii

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Hi,

I write my own component and need help with this.

In component I have
__published:
__property TDefFileld Items[int Index] ={read=GetF,write=SetF}
where TDefField is:

class TDefField : public TPersistent
{
public:
AnsiString FName;
AnsiString FType; // bool byte word integer ...
Byte FSyze;
Byte FDeci;
};

TdefField * __fasctcall GetF(int Index)
{
return Items[Index];
}

void __fascall SetF(int Index,TDefField *DF)
{
Items[Index]=DF;
}


How can I write property editor for this property ?

Thank very much.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users