Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!pyramid!infmx!aland From: aland@infmx.UUCP (Dr. Scump) Newsgroups: comp.databases Subject: Re: Informix 4gl forms - formonly syntax broken Summary: what syntax are you using? works for me... Message-ID: <464@infmx.UUCP> Date: 24 Sep 88 06:27:11 GMT References: <475@pan.UUCP> Organization: Informix Software Inc., Menlo Park, CA. Lines: 45 In article <475@pan.UUCP>, jw@pan.UUCP (Jamie Watson) writes: > > The Informix 4gl manual describes use of the 'formonly' field type, with > several associated keywords ("type", "like" and "not null"). However, the > 4gl forms compiler *only* accepts the "type" keyword as the first keyword > following the field-name. THis means that it is not possible to declare > formonly fields that are "like" some database field, Wrong. [E5] The exact syntax, quoted from page 3-16 of the manual: fieldtag = FORMONLY.field_name [TYPE [data_type | LIKE table.column]] [NOT NULL] [,attr_list]; This means that you can define it with a data type -or- LIKE a database column. Try this definition in a form using the demo "stores" database: f009 = formonly.phone2 TYPE LIKE customer.phone, reverse; perhaps you said just "LIKE" instead of "TYPE LIKE". > and it is not possible > to declare formonly fields "not null" without declaring a type for them. True enough, but you can't use a field with no type! Are you protesting the need to say "TYPE CHAR NOT NULL" (as per the documentation, see above) instead of "TYPE NOT NULL"? The syntax above shows that one or the other is required. ( [ a | b ] means "choose from a or b, but you must choose 1" -- If the whole entry was optional, it would say {[ a | b ]} ) > The examples given in the 4gl manual conveniently do not use any of the > optional keywords in the formonly declaration. The following example is in the orderform.per demo form (and Appendix A, p24): f019 = formonly.t_price TYPE MONEY; I agree that there should be more. I have examples that I can email upon request. > jw -- Alan S. Denney | Informix Software, Inc. | {pyramid|uunet}!infmx!aland Disclaimer: These opinions are mine alone. If I am caught or killed, the secretary will disavow any knowledge of my actions. Santos' 4th Law: "Anything worth fighting for is worth fighting *dirty* for"