From: "Kevin A. Carr"
I would expect it to behave according to the documentation.
However I would prefer OPTION 2. (This is the way C works with multiply =
assigned numeric expressions)
A third option might be to only allow multiple string assignments for =
strings of the same size (not length).
----------
From: Steve[SMTP:steve.watkins@semware.com]
Sent: Thursday, October 30, 1997 10:54 AM
To: 'tsepro@semware.com'
Subject: multiple assignments (ADVANCED USAGE). Opinions.
Suppose... I repeat suppose... that SC32 allowed multiple assignments of =
variables such as
n =3D m =3D p =3D 1
I would assume that the variables n,m, and p are all set to 1.
(For those of you who have already found this advanced feature.... =
ignore it for now)
But how would you expect the following to work?
string s[20], t[10], u[4]
s =3D t =3D u =3D "12345678901234"
Would you expect ? (OPTION 1)
u =3D "1234"
t =3D "1234567890"
s =3D "12345678901234"
the longhand version would be:
u =3D "12345678901234" // which truncates to "1234" since u is only 4 =
characters in size
t =3D "12345678901234" // which truncates to "1234567890" since t is =
only 10 characters in size
s =3D "12345678901234" // which does not truncate at all since s is 20 =
characters in size
or would you expect ? (OPTION 2)
u =3D "1234"
t =3D "1234"
s =3D "1234"
whose longhand is
u =3D "12345678901234" // which truncates to "1234" since u is only 4 =
characters in size
t =3D u // which sets t to "1234" since u =
is "1234"
s =3D t // which sets s to "1234" since t =
is "1234"=20
Put the string slice issue aside for now... Also, ignore the issue of =
BYTE or WORD types which could possibly be added for additional numeric =
storage... I'll bring that issue up later if need be...
What's your opinion? Should multiple assignments cause the right-hand =
value to be assigned to each left-handle variable (OPTION 1) or should =
the right-hand expression be assigned to each left-hand variable as it =
passes right to left (OPTION 2)?
Steve
SemWare
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|