Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting FIELDs doesn't work like Help says it should.

Status
Not open for further replies.

MoGryph

Programmer
Nov 1, 2000
99
US
I'm trying to simply create an action that will update a field. According to Help, to set a field in a document, it says use:

FIELD fieldname := value;

However, when I enter in my information, and click the green checkmark to verify my code, it always gives me an error message: "No main or selection expression in formula: ';'".

What in the world am I doing wrong?
 
I found an answer, though I'm not completely satisfied with it. For some reason, just placing that line in the action doesn't work. I also have to place another command after it, in the same action.

Still looking for any input if anyone has any.
 
If you are comfortable with Object Oriented design, you can think of an action button as a "Function" that must have a return value. The last value of any Formula must be left hanging to be returned by the function to the UI document.

The FIELD statement uses the value that you have given it, so there is nothing to return to the UI document. Typically, you would take advantage of the opportunity to slip in an @Command. Alternatively, you can return the NULL value.

FIELD fieldName := value;
@Command([ViewRefreshFields])

-or-
FIELD fieldName := value;
""


Kevin
 
When you explain it that way, it all makes much more sense. I hadn't thought of actions as functions like that, I was thinking of them more as something like a button, that would just do what you want it to and go on its' merry way... I was just about to give up in trying to understand Notes too. hehe.

Thanks a million!

-MoGryph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top