Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Runtime data type

Former Member
0 Likes
620

Hello every body,

here is static declaration:

Data var type C length 10.

i am trying to create a type at run time with following statement:

create data var type ( 'C' ).

the above statement will create a variable of type char with default length.

what if i want to specify the length (10)?

or in case of P type how will i set value for decimal.

5 REPLIES 5
Read only

Former Member
0 Likes
590

Hi,

Why don't you use the Filed Symbols if you want the Runtime types

Regards

Sudheer

Read only

0 Likes
590

How? Would you give me an example?

Read only

0 Likes
590

I agree with Sudheer..Field-Symbols are the best option and there are meant for the same.

Field-Symbols : <F>.

start-of-selection.

assign (var) to <F>.

After the above statement <F> has the value and type of variable VAR.

Considering your example...

assign (var) to <F>.

<F> = value.

should do the trick.

Regards

Anurag

Message was edited by: Anurag Bankley

Read only

Former Member
0 Likes
590

Hi,

Try this..

FIELD-SYMBOLS: <FS> TYPE ANY..

Thanks,

Naren

Read only

0 Likes
590

Folks,

I have:

data: dataref type ref to data.

field-symbols <anyType> type any.

data: value type string.

data: var type c length 10.

value = '5112912340'.

create data dataref type ('c').

assign dataref->* to <anytype>.

<anyType> = value.

dataref is of type C but will be of length (1),, how can i make it of length (10)???

Thanks