| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi I'm would like to use evaluate and have written the following test program. I works only partly. The procedure AllCapsFunc are executed via Evaluate but it does not return a value into StringVar. Why? Hope that you can help map AllCapsFunc procedure(string), string end Person group,pre(PERS),bindable FirstName string(20) LastName string(20) end NameStr string(20) StringVar string(20) result string(255) bind('FirstName',PERS:FirstName) bind('StringVar',StringVar) bind('SomeFunc',AllCapsFunc) bind('NameStr',NameStr) NameStr='jesper' Person.FirstName = 'Jesper' Person.LastName = 'Nielsen' StringVar = 'peter' result = evaluate('StringVar=SomeFunc(FirstName)') message('3:'&clip(result)) case clip(result) of '' if ErrorCode() message('Error ' & errorcode() & ' -- ' & Error()) else message('Unknown error') end of '0' message('no bind: ' & clip(StringVar)) of '1' message('result: '& clip(StringVar)) end return AllCapsFunc procedure(str) code message('1:'&clip(str)) str=upper(str) message('2:'&clip(str)) return(str) Regards Jesper |
|
#2
| |||
| |||
| Hi Jesper, > I works only partly. The procedure AllCapsFunc are executed via > Evaluate but it does not return a value into StringVar. Why? With "evaluate('StringVar=SomeFunc(FirstName)')" you are evaluating a logical expression - comparing StringVar with SomeFunc(Firstname), the result is false and evaluate() returns 0. Try:- StringVar=evaluate(SomeFunc(FirstName)) HTH, Simon |
|
#3
| |||
| |||
| Sorry, of course that should have been:- StringVar=evaluate('SomeFunc(FirstName)') On Jun 21, 8:36 am, Simon Kemp <si...@sdk.demon.co.uk> wrote: > Hi Jesper, > > > I works only partly. The procedure AllCapsFunc are executed via > > Evaluate but it does not return a value into StringVar. Why? > > With > > "evaluate('StringVar=SomeFunc(FirstName)')" > > you are evaluating a logical expression - comparing StringVar with > SomeFunc(Firstname), the result is false and evaluate() returns 0. > > Try:- > > StringVar=evaluate(SomeFunc(FirstName)) > > HTH, > Simon |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.