×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Passing variable value to other variable

Passing variable value to other variable

Passing variable value to other variable

(OP)
First I'm sorry for my bad english

Is there a way to pass value from one variable or field to other variable, like

VAR1='This is a string'
VAR2=99

Entry local variable UNOS STRING(10)

When I enter a value 'VAR1' in UNOS

Message(%UNOS) need to say 'This is a string'

Otherwise entering 'VAR2'

Message(%UNOS) need to say 99


Or something like that

regards,

RE: Passing variable value to other variable

Simply you can do this

CODE

VAR1='This is a string'
!enter value 'VAR1' in UNOS
UNOS = 'var1'
BIND('var1',var1)
message(evaluate(UNOS))

Regards
 

RE: Passing variable value to other variable

(OP)
Thanks for your reply

I'm not sure I explained the problem well:

I have something like
BAZ: Value1 = 123
BAZ: value2 = 456
BAZ: Value3 = 789

At second base will keep the field name

DDT: val1 = 'BAZ: Value1'
DDT: val2 = 'BAZ: Value2'
DDT: Val3 = 'BAZ: Value3'

Is there a way to tell if

ISM# = DDT: val1

I get the value  

ISM#=123

(DDT:val1 = BAZ:Value1 = 123)

PS.Since I have previously worked in the Clipper to be there, it looked like this
ISM# = &DDT:val1

regards,  

RE: Passing variable value to other variable

Thats what I said , but you have to bind the BAZ:Value1.. etc before using evaluate function. It is exactly like clipper's &.


Hope you got my point.

Regards
 

RE: Passing variable value to other variable

In your example

CODE

BAZ:Value1 = 123
DDT:val1 = 'BAZ:Value1'

BIND('BAZ:Value1',BAZ:Value1)

ISM# = evaluate(DDT: val1)

p.s : remove the spaces after : in your variables

Regards


 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close