Anyone know why the code below does not compile in the free version of uniface.
Is it a bug or is it a feature... that is the question :-)
It appears that 'any' works in the variables but not in the params in uniface 10.4.03 free addition
Params numeric
pTask: in
any test :in
EndParams
------------------------------
Osman Shariff
Freelance Uniface Consultant - France
Work in Europe in French, English and German
------------------------------
HI,
The documentation :
The Any data type can only be used in component variables, global variables, and entries (global or local Proc modules).
Don't talk about Operation....
------------------------------
Hortion Gilles
Dedalus Healthcare France
Artigues Pres Bordeaux FR
------------------------------
Anyone know why the code below does not compile in the free version of uniface.
Is it a bug or is it a feature... that is the question :-)
It appears that 'any' works in the variables but not in the params in uniface 10.4.03 free addition
Params numeric
pTask: in
any test :in
EndParams
------------------------------
Osman Shariff
Freelance Uniface Consultant - France
Work in Europe in French, English and German
------------------------------
Doesn't compile in the paid version either. Error message indicates the any type is explicitly denied to parameters.
The following compiles.
operation test
params
numeric pTask: in
$tester$ : IN
endparams
end
Where $tester$ is declared as an 'any' component variable. But I haven't tested it to see if it actually works.
You COULD try replacing the any with a struct, and using uniface's inherent conversions to put an 'any' variable into a struct leaf, and then back again into an 'any' variable in the proc.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------
Doesn't compile in the paid version either. Error message indicates the any type is explicitly denied to parameters.
The following compiles.
operation test
params
numeric pTask: in
$tester$ : IN
endparams
end
Where $tester$ is declared as an 'any' component variable. But I haven't tested it to see if it actually works.
You COULD try replacing the any with a struct, and using uniface's inherent conversions to put an 'any' variable into a struct leaf, and then back again into an 'any' variable in the proc.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------
The worrying thing is it works in 10.4.02 as a parameter variable.
So, I am not sure if the change was intentional or accidental.
If it is used in many cases then a correction will be very problematic and potentially break things.
------------------------------
Osman Shariff
Freelance Uniface Consultant - France
Work in Europe in French, English and German
------------------------------
Doesn't compile in the paid version either. Error message indicates the any type is explicitly denied to parameters.
The following compiles.
operation test
params
numeric pTask: in
$tester$ : IN
endparams
end
Where $tester$ is declared as an 'any' component variable. But I haven't tested it to see if it actually works.
You COULD try replacing the any with a struct, and using uniface's inherent conversions to put an 'any' variable into a struct leaf, and then back again into an 'any' variable in the proc.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------
Thanks Iain, for now I will wait on uniface to respond, but some good alternatives.
It says it is used in parameters for functions so maybe it's more a bug than a feature
Use in the params blocks of functions
------------------------------
Osman Shariff
Freelance Uniface Consultant - France
Work in Europe in French, English and German
------------------------------
Anyone know why the code below does not compile in the free version of uniface.
Is it a bug or is it a feature... that is the question :-)
It appears that 'any' works in the variables but not in the params in uniface 10.4.03 free addition
Params numeric
pTask: in
any test :in
EndParams
------------------------------
Osman Shariff
Freelance Uniface Consultant - France
Work in Europe in French, English and German
------------------------------
Hi Osman,
I am a little late to the conversation. I have tried this on 9.7 and found that a parameter of type any on an operation causes an error to be thrown by the compiler. How far back are you seeing this working?

Mike
------------------------------
Michael Taylor
Rocket Internal - All Brands
------------------------------