Re: Assigning a value to a variable
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Mike Segel wrote: > > Hmmm. > Are you sure that both are assignments? > Its been way too long since I've played with 4GL, but > usually in a language, (= is the assignment) > (= = or == is the conditional check.) > > i=20; > if (i== 20) then... > > OK? > > Savio Mario Bartholomeo Pereira wrote: > > > Hi, > > > > In 4GL to assign a value to a variable we have two methods > > > > 1. let i=20 > > > > 2. let i = = 20 > > > > what is the difference between these two statements Jonathan Leffler mentioned this recently, you can perhaps retrieve the relevant post from deja. Anyway, = is both the assignment operator and the test for equality in Informix 4GL. But it seems to have obtained undocumented support for == somewhere along the way. Following the advice in the (fairly old) manual I skimmed through once, you should use = for both i = 20 and IF i = 20 THEN no need for the brackets in a simple expression like that. You've been writing too much c lately. And, Rajesh, what are these damn things? Exam questions? -- Usenet, a global collection of flaming opinions and senseless babble, was designed as a way to eat up precious spool space on a system's hard drive. It also is a way for people to distribute pornography. (By Robert A. Hayden <www.geekcode.com>)
On Sat, 19 Aug 2000 20:15:19 +0200 Andrew Pearson wrote: > > Anyway, = is both the assignment operator and the test for > equality in Informix 4GL. But it seems to have obtained > undocumented support for == somewhere along the way. > Its quite handy that it does this IMO as I spend more time with languages that require '==' as the equality operator , same goes for the semicolons at the ends of statements :) /J\\ -- yapc::Europe in assocation with the Institute Of Contemporary Arts <http://www.yapc.org/Europe/> <http://www.ica.org.uk>