mastar Posted September 14, 2006 Share Posted September 14, 2006 I have 2 fields in a layout that I need to substract. Messagecounts and a BaseMsgCount.. I want to substract Messagecounts and a BaseMsgCount.. and if the results is greater than 0, plug the results in a 3rd field on my layout screen. 2nd unrelaed question, Some how my layout screen header and footers are blue in color.. How do I change this color scheme to white.. I tried all the FILL functions I could find to no avail? 3rd question. Reading these messages in the forum, I see some folks somehow use a textbox w/slider inside theses messages to show code etc.. Hows is this done ? Thanks again, Link to comment Share on other sites More sharing options...
Maarten Witberg Posted September 14, 2006 Share Posted September 14, 2006 I have 2 fields in a layout that I need to substract. Messagecounts and a BaseMsgCount.. I want to substract Messagecounts and a BaseMsgCount.. and if the results is greater than 0, plug the results in a 3rd field on my layout screen. Case (Messagecounts-BaseMsgCount>0;Messagecounts-BaseMsgCount) 2nd unrelaed question, Some how my layout screen header and footers are blue in color.. How do I change this color scheme to white.. I tried all the FILL functions I could find to no avail? Go to layout mode, ctrl-click (or is it alt click on windows? not sure, one of those) on the part divider label thingy, a floating menu appears that allows you to select a background color and pattern 3rd question. Reading these messages in the forum, I see some folks somehow use a textbox w/slider inside theses messages to show code etc.. Hows is this done ? Use the buttons in the advanced editor to wrap selected text in various tags, such as quote and code tags. You're referring to the code tags, the button for this is marked #. Or type [c o d e]blah blah[/ c o d e] directly (without the spaces) kjoe Link to comment Share on other sites More sharing options...
mastar Posted September 14, 2006 Author Share Posted September 14, 2006 Thank you for your quic reply, Pertaining to question #1, sorry, I did not mean to store the results to a 3rd field but just plug results into the layout if that makes a difference. Would I first create a textbox on my layout where I want the resultant of my calculation to appear. Then, select scriptmaker, then do a Set Field or something else since I am not saving resuls in a field as first thought of.. because this seems like the only why to get to theis CASE command. I just need alittle more help & explanation to what your insight is and what I am trying to accomplish. (((PS.. I am more familar with dbase programming, the syntax, of these codes are foriegn to me, I have FM Bible, this book just isn't explanatory enough discribing the FM language syntax, I see as my weakness understanding FM.. Can you suggest another source to learn more regarding the programming language) )) Thanks in advance, the short time being a member of this forum, I recognise your name regularly here helping people like myself and would like to take a moment to thank everyone for all your help with people especially us newbies who ask so many stupid like question Link to comment Share on other sites More sharing options...
Maarten Witberg Posted September 14, 2006 Share Posted September 14, 2006 just plug results into the layout if that makes a difference.Would I first create a textbox on my layout where I want the resultant of my calculation to appear.Then, select scriptmaker, then do a Set Field or something yes, you could do it that way. The script would be if [ YourTable::Messagecounts-YourTable::BaseMsgCount>0 ] set field [ YourTable::YourNumberField ; YourTable::Messagecounts-YourTable::BaseMsgCount ] end if Please note that "YourTable::" can be any table related to the table the calc is being evaluated in the context of, if you catch my drift. However, I do not see the need to do this as a calculation would perform the exact same job. What else would this script do? Or what procedure are you working on? or what other values might the field need to hold? kjoe PS there's no such thing as a stupid question. Link to comment Share on other sites More sharing options...
LaRetta Posted September 15, 2006 Share Posted September 15, 2006 I did not mean to store the results to a 3rd field but just plug results into the layout if that makes a difference. A field is required to display any results. It can be a calculation or a standard field but you need a field. You can then just display the field on a layout using Insert > Merge Field or you can place the field directly on your layout. smiley-smile Link to comment Share on other sites More sharing options...
Maarten Witberg Posted September 15, 2006 Share Posted September 15, 2006 Good one... It sounds as if Mastar wants a merge field, but also as if he wants a scripted way of setting field content... I went for the latter. OK Mastar, it's your call now kjoe Link to comment Share on other sites More sharing options...
mastar Posted October 10, 2006 Author Share Posted October 10, 2006 Thanks, You say, >>>A field is required to display any results. It can be a calculation or a standard field but you need a field. I probally missed something in the basics. will this $var also be consider as field.. just not inside table as a field Isn't there a SET VARIABLE($var1, " ") or something like this command to create a $local or $$global variable... I haven't figured yet how one uses these pull downs, clicking [specify..] buttons to insert Or even follow a $var in the viewer window One of my newbie problems is getting the code to work.. I keep getting these little windows saying something is missing I guess am not completely comfortable creating lots fields to do stuff, its seems like a glutten way of doing things, just need to have a xvariable to calculate with.. Gettin around, learning some of these tricks or FM way of doing things I think even the manuals, VTC training etc,, don't give you. Link to comment Share on other sites More sharing options...
LaRetta Posted October 10, 2006 Share Posted October 10, 2006 Using a script variable to calculate is fine. DISPLAYING the results of its count is another. If you select Data Viewer, click the +, type $var (or whatever your variable name) then it will display what is in that variable when it runs (but put Debugger on or it will happen too fast to see). Script variables clear when script ends. And no, variables can't be displayed on layout - only in Data Viewer. Link to comment Share on other sites More sharing options...
Recommended Posts