Subject: SDL-News: Re: Help on SDL
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Tue Jun 29 2004 - 21:27:28 GMT
Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----
Yeoh Chun Yeow at yeow#rndtm.net.my wrote on 28/06/04 15:22:
> I am assigning one variable as Octet_string
> dcl Oc Octet_string;
> but once I try to access the 1st Octet element of the Octet_string, let say:
> Oc(1) := Oc(2)
> it comes out with the following error:
> 1: ERROR 66 Several matches ? Oc( 2) := Oc( 1)
> but once I do the type matching,
> <<type Octet>> Oc(1) := Oc(2)
> the following errors occur:
> 1: ERROR 346 No visible variable or formal parameter with this name ? <<type
> Octet>> Oc( 2) := Oc( 1)
> Can you give me advice to solve this? Thanks
Dear Yeoh Chun Yeow,
The errors will go away if you write:
Oc(<<TYPE Integer>>1):=Oc(<<TYPE Integer>>2)
The problem is with resolving the Integer literal values rather than
resolving the Octet_string variables.
However, in my opinion this should not be necessary as Oc is clearly of type
Octet_string. When followed by round brackets Oc would have to be an indexed
variable and the only allowed index is Integer. The tool should be able to
resolve this without the qualifier.
On the other hand, the left hand side of
<<type Octet>> Oc(1) := Oc(2)
is NOT correct. The qualifier <<type Octet>> is bound to the next identifier
to the right - in this case "Oc" and not to the whole expression "Oc(1)".
Moreover a qualifier gives the context to which the following name should be
bound and "Oc" is not defined in Octet. By comparison the <<TYPE Integer>1
is telling the tool to use the item named "1" defined in the context
"Integer" - that is the integer literal 1. The tool is correct to generate
an error here.
It is not valid to qualify a variable with the data type used in the
definition of the variable - in other words a qualifier such as <<type
Octet>> is NOT a casting operator. Such a qualifier can only be used to
qualify the names defined by the data type: the literals and operators.
-- Rick Reed - rickreed#tseng.co.uk Tel:+44 15394 88462 Mob.:+44 7970 50 96 50
--End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>
This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:50 GMT