BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Variable by Name
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Mauro Magalhães
Guest





PostPosted: Sun Nov 23, 2003 12:36 am    Post subject: Variable by Name Reply with quote



I need take a variable value passing variable name by reference. How
can I do it? Example:
Var
Fator : Double;

I need Fator value referencing as string "Fator". Thanks!
Back to top
Jud McCranie
Guest





PostPosted: Sun Nov 23, 2003 1:10 am    Post subject: Re: Variable by Name Reply with quote



On 22 Nov 2003 16:36:18 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalhães)
wrote:

Quote:
I need take a variable value passing variable name by reference. How
can I do it? Example:
Var
Fator : Double;

I need Fator value referencing as string "Fator". Thanks!

To pass a parameter by reference, put VAR before it in the
procedure/function statement.


Back to top
Mauro Magalh?es
Guest





PostPosted: Mon Nov 24, 2003 2:19 am    Post subject: Re: Variable by Name Reply with quote



Jud McCranie <j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote

Quote:
On 22 Nov 2003 16:36:18 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalhães)
wrote:

I need take a variable value passing variable name by reference. How
can I do it? Example:
Var
Fator : Double;

I need Fator value referencing as string "Fator". Thanks!

To pass a parameter by reference, put VAR before it in the
procedure/function statement.

Sorry! I don´t want pass a parameter, I want take a variable value
taking variable name. I need a way to search a variable into memory by
name.

Back to top
Frank Andreas de Groot
Guest





PostPosted: Mon Nov 24, 2003 3:05 am    Post subject: Re: Variable by Name Reply with quote

Use a class and use RTTY.

"Mauro Magalh?es" <maurosm (AT) terra (DOT) com.br> wrote in message
Quote:

Sorry! I don´t want pass a parameter, I want take a variable value
taking variable name. I need a way to search a variable into memory by
name.



Back to top
Jud McCranie
Guest





PostPosted: Mon Nov 24, 2003 3:08 am    Post subject: Re: Variable by Name Reply with quote

On 23 Nov 2003 18:19:06 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

Quote:
Sorry! I don´t want pass a parameter, I want take a variable value
taking variable name. I need a way to search a variable into memory by
name.

I think if you have it generate a detailed MAP file, (options/linter
tab) that might be what you want.


Back to top
Frank Andreas de Groot
Guest





PostPosted: Mon Nov 24, 2003 3:11 am    Post subject: Re: Variable by Name Reply with quote

"Frank Andreas de Groot" wrote

Quote:
Use a class and use RTTY.

Oops, that should be RTTI, Run-time Type information.
Published properties are queryable by name at runtime.
I've done it with the Font.Charset property.

It's devilishly complicated and slow though and RTTI is not well documented.



Back to top
Nicholas Sherlock
Guest





PostPosted: Mon Nov 24, 2003 4:03 am    Post subject: Re: Variable by Name Reply with quote

Jud McCranie wrote:
Quote:
On 23 Nov 2003 18:19:06 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

Sorry! I don´t want pass a parameter, I want take a variable value
taking variable name. I need a way to search a variable into memory
by name.

I think if you have it generate a detailed MAP file, (options/linter
tab) that might be what you want.

No, normal variable names are not recorded in the MAP file. If you use
published properties of a class, they are stored. Otherwise, no.

Cheers,
Nicholas Sherlock



Back to top
Jud McCranie
Guest





PostPosted: Mon Nov 24, 2003 4:45 am    Post subject: Re: Variable by Name Reply with quote

On Mon, 24 Nov 2003 17:03:51 +1300, "Nicholas Sherlock"
<n_sherlock (AT) hotmail (DOT) com> wrote:

Quote:
No, normal variable names are not recorded in the MAP file. If you use
published properties of a class, they are stored. Otherwise, no.

For one thing, I didn't really understand what the OP was asking.

These variables (StartDate, etc) are local variables to the unit that
has VacReqForm, and they are listed in the map file. Am I
misunderstanding something?

0002:001E370C VacReqForm
0002:001E3710 .2
0002:001E3714 StartDate
0002:001E371C EndDate
0002:001E3724 EarliestUnprinted
0002:001E372C VacRequestList


Back to top
Nicholas Sherlock
Guest





PostPosted: Mon Nov 24, 2003 6:32 am    Post subject: Re: Variable by Name Reply with quote

Jud McCranie wrote:
Quote:
On Mon, 24 Nov 2003 17:03:51 +1300, "Nicholas Sherlock"
[email]n_sherlock (AT) hotmail (DOT) com[/email]> wrote:

No, normal variable names are not recorded in the MAP file. If you
use published properties of a class, they are stored. Otherwise, no.

For one thing, I didn't really understand what the OP was asking.

These variables (StartDate, etc) are local variables to the unit that
has VacReqForm, and they are listed in the map file. Am I
misunderstanding something?

0002:001E370C VacReqForm
0002:001E3710 .2
0002:001E3714 StartDate
0002:001E371C EndDate
0002:001E3724 EarliestUnprinted
0002:001E372C VacRequestList

Oops.. sorry, guess I got it wrong this time Smile.

OP - maybe if you told us what you needed this for we could give you more
useful advice? (Along the lines of.. you don't actually need to access them
by name..)

Cheers,
Nicholas Sherlock



Back to top
Mauro Magalh?es
Guest





PostPosted: Mon Nov 24, 2003 12:02 pm    Post subject: Re: Variable by Name Reply with quote

"Nicholas Sherlock" <n_sherlock (AT) hotmail (DOT) com> wrote

Quote:
Jud McCranie wrote:
On Mon, 24 Nov 2003 17:03:51 +1300, "Nicholas Sherlock"
[email]n_sherlock (AT) hotmail (DOT) com[/email]> wrote:

No, normal variable names are not recorded in the MAP file. If you
use published properties of a class, they are stored. Otherwise, no.

For one thing, I didn't really understand what the OP was asking.

These variables (StartDate, etc) are local variables to the unit that
has VacReqForm, and they are listed in the map file. Am I
misunderstanding something?

0002:001E370C VacReqForm
0002:001E3710 .2
0002:001E3714 StartDate
0002:001E371C EndDate
0002:001E3724 EarliestUnprinted
0002:001E372C VacRequestList

Oops.. sorry, guess I got it wrong this time Smile.

OP - maybe if you told us what you needed this for we could give you more
useful advice? (Along the lines of.. you don't actually need to access them
by name..)

Cheers,
Nicholas Sherlock

I am trying to create a parser for a expression like Evaluate/Modify
window, because I need get results from a expression that uses literal
values, objects references and variable names. If you can help I will
be happy.

Thank you!

Back to top
J French
Guest





PostPosted: Mon Nov 24, 2003 1:27 pm    Post subject: Re: Variable by Name Reply with quote

On 24 Nov 2003 04:02:50 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

<snip>
Quote:

I am trying to create a parser for a expression like Evaluate/Modify
window, because I need get results from a expression that uses literal
values, objects references and variable names. If you can help I will
be happy.

In other words, you are writing an interpreter ?

A few more details, or a simple example might help

Back to top
Mauro Magalh?es
Guest





PostPosted: Tue Nov 25, 2003 10:48 am    Post subject: Re: Variable by Name Reply with quote

[email]erewhon (AT) nowhere (DOT) com[/email] (J French) wrote in message news:<3fc20663.275406624 (AT) news (DOT) btclick.com>...
Quote:
On 24 Nov 2003 04:02:50 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

snip

I am trying to create a parser for a expression like Evaluate/Modify
window, because I need get results from a expression that uses literal
values, objects references and variable names. If you can help I will
be happy.

In other words, you are writing an interpreter ?

A few more details, or a simple example might help



Yes, I need to write an expression evaluator like Delphi´s Evaluate/Modify
window (ctrl F7). Something like this: '(2 * 4) / Fator', where
"Fator" will assume the value of a variable passed to the expression.

Regards, Mauro.

Back to top
Jud McCranie
Guest





PostPosted: Tue Nov 25, 2003 4:05 pm    Post subject: Re: Variable by Name Reply with quote

On 25 Nov 2003 02:48:10 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

Quote:
Yes, I need to write an expression evaluator like Delphi´s Evaluate/Modify
window (ctrl F7). Something like this: '(2 * 4) / Fator', where
"Fator" will assume the value of a variable passed to the expression.

That is called an "expression evaluator", and there are routines
written for that.


Back to top
J French
Guest





PostPosted: Tue Nov 25, 2003 10:36 pm    Post subject: Re: Variable by Name Reply with quote

On Tue, 25 Nov 2003 11:05:50 -0500, Jud McCranie
<j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote:

Quote:
On 25 Nov 2003 02:48:10 -0800, [email]maurosm (AT) terra (DOT) com.br[/email] (Mauro Magalh?es)
wrote:

Yes, I need to write an expression evaluator like Delphi´s Evaluate/Modify
window (ctrl F7). Something like this: '(2 * 4) / Fator', where
"Fator" will assume the value of a variable passed to the expression.

That is called an "expression evaluator", and there are routines
written for that.


Some time ago there was a Russian guy advertising an interpreted
Pascal in this (or a related NG)

Personally I would write my own

Back to top
Jud McCranie
Guest





PostPosted: Wed Nov 26, 2003 1:46 am    Post subject: Re: Variable by Name Reply with quote

On Tue, 25 Nov 2003 22:36:06 +0000 (UTC), [email]erewhon (AT) nowhere (DOT) com[/email] (J
French) wrote:

Quote:
Some time ago there was a Russian guy advertising an interpreted
Pascal in this (or a related NG)

Personally I would write my own

And I don't think you need to know the memory addresses at which the
variables are stored, to do an expression evaluator.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.