pjohns
10th March 2009, 19:13
Hello,

I'm not sure what I should declare an enum field in an exchange condition as.

My condition looks like this -
==================
table ttdsls041
long opri

select tdsls041.opri
from tdsls041
where tdsls041._index1 = {:tdsls045.orno, :tdsls045.pono}
selectdo

opri = tdsls041.opri

endselect

return(opri)

=======================

I get an illegal type combination when checking the syntax.

Can somebody please point me in the correct direction?

Thanks

PJ

ks_ks_
10th March 2009, 19:40
what is the datatype of the field tdsls041.opri?

mark_h
10th March 2009, 19:50
I agree - you probably just need to change the domain of opri to the same as tdsls041.opri.

bdittmar
10th March 2009, 19:52
Hello,

I'm not sure what I should declare an enum field in an exchange condition as.

My condition looks like this -
==================
table ttdsls041
long opri

select tdsls041.opri
from tdsls041
where tdsls041._index1 = {:tdsls045.orno, :tdsls045.pono}
selectdo

opri = tdsls041.opri

endselect

return(opri)

=======================

I get an illegal type combination when checking the syntax.

Can somebody please point me in the correct direction?

Thanks

PJ



Hello,

if you want the description of the ENUM then use :

enum.descr$()

--------------------------------------------------------------------------------

Syntax
string enum.descr$(string domain_code(12), enum_expr
[, string language_code ] )

Description
This returns the description associated with a specific value in an enumerated domain.

Arguments
domain_code
The name of the domain. The domain must be of type enumerated.

enum_expr
One of the possible values of the enumerated domain.

language_code
To retrieve the description in a language other than the user language, specify the relevant language code in this argument. This is an optional argument. The default language is the language of the user.

Note that the language code of the user is available in the predefined, read-only variable language$.


Return values
The description of the specified enumerate value, either in the current user language or in another specified language.

The function returns an empty string, and displays an error message, if an unknown domain is specified or if no description exists in the data dictionary for the specified language.

Context
Bshell function.

Example
This example assumes an enumerated domain 'tcyesno' with two possible constants: 'tcyesno.yes' and 'tcyesno.no'. It also assumes that 1 is the language code for Dutch, 2 is the language code for English, and 3 is the language code for German. English is the current user language.

domain tcyesno active | enumerated domain
string descr(25)

active = tcyesno.no
descr = enum.descr$("tcyesno", active, "1") | descr contains "nee"
descr = enum.descr$("tcyesno", active) | descr contains "no"
descr = enum.descr$("tcyesno", active, "3") | descr contains "nein"


OR


Enumerates overview and synopsis

--------------------------------------------------------------------------------

Overview
Use these functions for handling enumerated domains and table fields.

Synopsis
domain
ask.enum
( string quescode(14), domain default_enumvalue [, arg ] ... )
string
enum.descr$
( string domain code(12), enum_expr [, string language_code] )
long
etol
( domain domain_value )
domain
ltoe
( long long_value )
void
set.enum.values
( enum_constant, ... )
void
set.ask.enum.values
( enum_constant, ... )
void
set.enum.values.for.field
( const string field.name.string, [ALL_ENUMS_EXCEPT], enum_value, ... )
void
set.initial.enum.values.for.field
( const string field.name.string, [ALL_ENUMS_EXCEPT], enum_value, ... )



Regards

pjohns
11th March 2009, 11:49
Thanks for all your input it's working now.

bdittmar you answered my next question with regards to getting the enum description so an extra thanks for that.

My working condition ended looking like this -

===================================
table ttdsls041
string opri(9)

select tdsls041.opri
from tdsls041
where tdsls041._index1 = {:tdsls045.orno, :tdsls045.pono}
selectdo

opri = enum.descr$("tdse.opri", tdsls041.opri)

endselect

return(opri)
=======================================

Cheers

PJ