Bind and Evaluate

clarion

    Next

  • 1. Clarion 6.1 Further Errors
    Yesterday I had a problem when upgrading from c6.0 to c6.1. Russell helped diagnose the fact that I had an old version of C60runx.dll lying around. I got rid of the old version of the dll but now, on this one application, I get the error on compile of "The procedure entry point _7control_AdjustForBorder@FR7tagRECTUI could not be located in the dynamic link library c60runx.dll" Can anyone help with this please? Milton
  • 2. Converting Date Field from dBase VI to 5.5ee
    Can anyone suggest a method to convert a dBase VI date field (yy/yy) to a Clarion date field?
  • 3. Web-Application in Clarion
    Hi All I am a new member in this group. We are planning to develop an application for on-line shopping. Please advice me for best database with Clarion6 for this web-application and Internet Service Provider to Host this application. Is there any web-application developed in Clarion6 ? If so, site address please. Jain
  • 4. Embed point
    Hi folks Can anyone tell me what the ABC embed point is that's the equivalent of the Activity for Each Record point when using the Process Template? Thanks David Proudfoot
  • 5. Unable to preview reports
    Hi, I have a problem at one site where they are unable to preview any reports. If they print without previewing it works fine but when they try to preview, the system locks up. I think the problem is that the system cannot create the windows meta files for the preview but I don't know why that would be. They are using win2k server and its a clarion 5b application. They have plenty of disk space available. Any help is appreciated. Thanks Gary

Bind and Evaluate

Postby ikrami2000 » Sun, 18 Jan 2009 19:06:08 GMT

I have one queue like :

Name : ikrami
Value : 100

Name : Karim
Value : 200

Name : Hady
Value : 150


now when i want to evaluate some values like :

ikrami    it will return 100

but if i put like a formula does not work :


ikrami + karim     return empty

i am doing it one time like :

BIND(Assump:Que.Name,Assump:Value)
Evaluate (clip(Equation))   ! Which  equation = ikrami + karim

this one give me empty

and if i put loop before BIND   it's return last value for last record
in the Queue

Re: Bind and Evaluate

Postby pblais » Mon, 19 Jan 2009 01:54:43 GMT

equation = 'ikrami + karim' ! note the quotes

Answer = EVALUATE(Equation)

IF ERROCODE()
   You probably screwed up the equation
END  

Equations are ALWAYS a string (or CString)
results are always a string, but you can use Clarions auto type
conversion if you expect a number.  What you got ins the equation was
the addition of two strings and that is always zero




---------------------------------------
 Paul Blais -  Hayes, {*filter*}ia

Re: Bind and Evaluate

Postby ikrami2000 » Mon, 19 Jan 2009 04:25:11 GMT

I am agree with you , but if i have two fields in the same record i
can do this equation for example :

ID         Value1          Value2         Value3
1           10              20             30

x = Evalauate(Value1 + Value2 )

x = 30

i did this

but my problem now that i have like :

Name       Value
value1      10
Value2      20
Value3      30

so  x = Evaluate(Value1)
x = 10

but if i put   x = Evaluate(Value1 + Value2)   return  empty

this is the problem

Re: Bind and Evaluate

Postby pblais » Mon, 19 Jan 2009 10:29:13 GMT

Evaluate only knows the string as input the fields are already bound
as well. depending on the driver

Change the expression to this and it will work:

x = Evaluate('Value1 + Value2')  ! you need the single quotes




---------------------------------------
 Paul Blais -  Hayes, {*filter*}ia

Re: Bind and Evaluate

Postby ikrami2000 » Mon, 19 Jan 2009 14:41:47 GMT

I found it


Loop H# = 1 To Records(Formula_Que)
  Get(Formula_Que,H#)
  BINDEXPRESSION(Formula_Que.For:Field,Formula_Que.For:Value)
End
   Result = Evaluate(Value1 + Value2)

Now it's ok evaluate from Queue

But i have small question :

if the field  with space not working

Evaluate(value1 + Value2)  ok

Evaluate(Value1 + CRM Server)  not working because  space in ( CRM
Server)

Similar Threads:

1.bind and evaluate in Clarion 5.5

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.evaluate() implicit bound functions...?

3.Why some thing evaluate to #t when they should evaluate to false

Having some experience with Python, the following things evaluate to
False in a boolean sense:
False, None, [], 0 etc

However in scheme the following evaluate to #t when passed as a
boolean to another function:
'(), 0, etc.

leading to extra typing such as
(if (not (null? x)) (do-when-list-has-stuff) (do-when-list-is-empty))
or
(if (zero? x) (do-false-thing) (do-true-thing))

when it seems more natural to me to do:

(if x (do-true-thing) (do-false-thing)) where x can be a null list and
works "like python" , since that is more familiar to me.

How/why?  Is it un-idiomatic or un-scheme-y to write some function
bool which returns #f when passed 0, empty list, etc?

thanks
Michael

4.in iwidgets ,tabnotebook, will tcl evaluate the entire code when it runs or it will evaluate

hi i am using iwidgets ,tabnotebook .In tabwindow suppose there r 5
pages,
so will tcl evaluate the entire code when it runs or it will evaluate
that code which page is selected


eg
for tab page1
1)i have entry and button


for tab page2
1)i have label and text
and so on


now page1 is selected
so when i run this tcl file will it make in background the label and
text or it will make only when page 2 is selected


 
thanks
regards harish

5.Binding or not binding

Hello,

Could you please first excuse me if my past and maybe future posting in this 
group were (will be) sometimes awkward. But I will really like to be more 
active using and promoting Ada.

I was really interested by the thread about "How come Ada isn't more popular?"

I would like to have your opinion about the best way to go in the future, 
and in particular if binding a C library is really the way to go.
  
When we talk about reuse does it mean reusing the libraries done in an other 
language ? 
Re-implementing zlib in Ada for example. Is it a waist of time ?
How to choose ? where to start writing in Ada ?
 
If I need some compression lib like jpeg2k for example which way to go ?
I would love to be able to manipulate some DICOM image format in Ada for 
example. Most of the actual project implementing the DICOM standard are in 
C++ and java. Is it only a question of money (project funding) ? 

Thanks for your feedback in the professional and the hobbyist side.

-- 
Ali 

6. register-groups-bind binds to simple arrays

7. apply vs destructuring-bind vs multiple-value-bind

8. binding canvas item versus binding canvas widget



Return to clarion

 

Who is online

Users browsing this forum: No registered users and 70 guest