pmusaev Posted December 12, 2003 Posted December 12, 2003 any idea how to change the background colour of a document from white, or maybe have additional zoom options available for a document to fit inside the window. i am using version 5.5. cheers!
John Caballero Posted December 12, 2003 Posted December 12, 2003 On a PC: Go into Layout mode, make sure you can see the status area to the left and the tabs that define the different parts of the layout ("body", "header", "footer" etc). Right click on a layout part. You should see a Fill Color option. On a Mac...anyone...anyone?
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 John to the rescue!!!! thankya sir. on a side note, since i got you here already... i am trying to create a field that will take it's previous amount and add more to it. how is this best achieved. i'm finding that my value is getting formatted to '0' before the calculation is executed. ie. if( field1 = "001" ) set field2 = field2 + 2 + 2 something like that... by the way, let's do lunch John, it's on me! that is if you ever come up to Vancouver, BC. have a good one mate.
John Caballero Posted December 12, 2003 Posted December 12, 2003 Your example differs a bit from what the description of what you're trying to do. Your example deals with two fields, whereas your description mentions only one field. Are you trying to script this or use a calculation? Vancouver, eh? Great city. I like steak.
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 either way would be ok... if i ran a script that would take the exisitng value of a field and add more too it, rather then initilize it. clearer? sorry... i'm such a newbie!
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 noooo... a calculation... because a script would just keep adding it on everytime it was run... i am trying to do a timecard dBase, that tracks a certain amount of hours for any given job cost code. hmmmmmmmm
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 john, what is the correct syntax when using an "If" statement within a calculated field type...
John Caballero Posted December 12, 2003 Posted December 12, 2003 So then you're talking about setting value of a field in record X based on the value of the same field in record Y? If that's the case, will the records always be "adjacent" to each other?
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 hmmm... more so, increasing the current value of a field by a certain amount based on its current value. but doing so, not on a script because anytime the script will run, it will update the field, this should only happen once, so that's why i'm thinking that a calculation field is the way to go, now i need to incorporate an "If" statement within my calculated field that will test for certain conditions and update itself accordingly. i hope that's not confusing john, if you are growing impatient please let me know, i'll stop.
John Caballero Posted December 12, 2003 Posted December 12, 2003 Naw...I'm patient to a fault. What is the condition that needs to be met in order for the increase to occur? The basic syntax for an If statement is: If(test, result if true, result if false) Example, If(UserName="John", "I am John", "I am not John") Obviously you can test for all sorts of conditions, and the results don't have to be text. And you can nest them: If(UserName="John", "I am John", If(UserName="Bill", "I am Bill", "I am neither John nor Bill")) There have been lots of discussions here about using Case statements instead of If statements. I personally prefer Case.
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 that's almost there John, thank you! i am not sure what Case statements are exactly, but if they could help me here, i'll consider them. with the examply you've provided, my "If" statements are going to get messy because I have a lot to check against.
John Caballero Posted December 12, 2003 Posted December 12, 2003 What are the conditions you're checking for?
pmusaev Posted December 12, 2003 Author Posted December 12, 2003 i have this timecard dBase, and there are job codes for each different aspect of one job, so i have it setup where the cost code fields are on top and the days of the week underneath. i need to check each different cost code field up top to see if a certain cost code is present (someone typed it in), if it is... then i add up the days underneath that cost code field into another field that is stored for ever and ever, creating a project forecast report. make sense?
John Caballero Posted December 13, 2003 Posted December 13, 2003 When you say you're adding days underneath, what data are you trying to sum? I don't think you're trying to add dates (how could you - what is 12/12/03 + 12/11/03, for example). This sounds pretty simple if there is some numeric value that you're trying to sum. If(costcode="xyz", Day1Data + Day2Data + Day3Data..., TextToNum("")) Of course, one of the things that separates me from the big spuds here is they have the ability to conceive of a presented issue in a larger sense. I have to get lots of clarification before I can offer a suggestion.
pmusaev Posted December 13, 2003 Author Posted December 13, 2003 the data i am summing is numbers, not dates... sorry bout that john. yah, it's the total hours worked for a given cost code. so the dates are all static within the time card. what is with the TextToNum(") function within that If statement? what is the function exactly? i can get this to work with a BIG nested If statment, like the example you showed me earlier. maybe using some portals would be better? i dunno! i'm starting to see some results here though, so thank you for the shove in the right direction john, much appreciated.
John Caballero Posted December 13, 2003 Posted December 13, 2003 TextToNum("") sets a number field to be null. TextToDate("") does the same for a date field.
pmusaev Posted December 13, 2003 Author Posted December 13, 2003 how many "If" statements can be nested John? and what is the correct syntax
-Queue- Posted December 13, 2003 Posted December 13, 2003 I've never found the use of TextToNum("") necessary. I use TextToDate("") all the time, but it seems either unnecessary or redundant to use for numbers when "" works just as well and doesn't leave a question mark in the field. Have you experienced otherwise?
CobaltSky Posted December 13, 2003 Posted December 13, 2003 pmusaev said: how many "If" statements can be nested John? and what is the correct syntax Hello pmusaev, I believe the answer to your question is 168. You'll find all the detail in a TechInfo article on the FMI site at: http://www.filemaker.com/ti/101536.html The syntax for nesting If statements follows either two forms (and various combinations, permutations and extensions of them) - single branching and dual branching. A typical single branch nested If( ) expression extended to one level takes the form: If(A = B, "C", If(C = D, "E", "F")) - where a second expression is given as the the 'result-if-false' for the first. A third expression can then be entered if desired, as the 'result-if-false' for the second If( ) function to nest to a further level, and so on. Dual branching nested If( ) expressions follow a similar path, but both the result-if-true and the result-if-false engender further If( ) clauses - eg: If(A = B, If(C = D, "E", "F"), If(G = H, "I", "J")) This can rapidly become rather convoluted and difficult to interpret unless some formatting is applied. Frequently, as John has indicated, the greater flexibility of the Case( ) is preferable, as it provides the capability for multiple tests and results within a single function as well as making the 'result-if-false' optional. But there are no hard and fast rules about this. Last, but not least, you might be interested to take a look at a demo file which can be downloaded from: http://www.nightwing.com.au/FileMaker/demos2.html#d9 - which shows a way to set up a field to accumulate the sum of all values (historically) that are entered into another field within the same record. It just might give you a lead on what you're looking for in relation to one of the other issues being teased out on this thread.
John Caballero Posted December 15, 2003 Posted December 15, 2003 -Queue- said: I've never found the use of TextToNum("") necessary. I use TextToDate("") all the time, but it seems either unnecessary or redundant to use for numbers when "" works just as well and doesn't leave a question mark in the field. Have you experienced otherwise? Nope - I haven't experienced otherwise. I just do it for my own internal sense of consistency.
Recommended Posts
This topic is 7648 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now