VICH Posted September 1, 2005 Posted September 1, 2005 (edited) i don't want to set the field to the script parameter but define the field i want to be set to the script parameter... i want field (script parameter) to be set to .....whatever... Edited September 1, 2005 by Guest
RalphL Posted September 1, 2005 Posted September 1, 2005 Script parameters are not fields. You can define them when you make a button or when you write a script. They can be defined as a calculation.
VICH Posted September 1, 2005 Author Posted September 1, 2005 can you give me an example of what you mean...because i wrote a script if [script parameter = ""] set field [ , "x" else set field [ , ""] i wrote it so that i could use it on several fields for the same purpose and i set it to the fields and set the script paramter to just equal that field...but how do i define the set fields to go to that field as well
RalphL Posted September 1, 2005 Posted September 1, 2005 Try: if [ IsEmpty (Get (SriptParameter))] You need to use the Get to get the value of the script parameter.
VICH Posted September 1, 2005 Author Posted September 1, 2005 well where is says script parameter i left off the get part..that part isn't the problem is the set field...i know what i want to set the field to...i just need to be able to tell where to set
RalphL Posted September 1, 2005 Posted September 1, 2005 Normally the set field names the field. If no field is named it will use the field selected in the browse or find mode. You may want to add a go to field step in your script.
VICH Posted September 1, 2005 Author Posted September 1, 2005 i can't really select the field because i am making it into a button...can you set go to fields to script parameters...i'd check but i am updateing my software....
RalphL Posted September 1, 2005 Posted September 1, 2005 Why don't you assign the parameter with the button, say the field name. If [isEmpty (Get (SriptParameter))] set field [Get (SriptParameter) , "x" else set field [Get (SriptParameter) , ""]
VICH Posted September 1, 2005 Author Posted September 1, 2005 (edited) wait.... how do i set it up like that Edited September 1, 2005 by Guest
RalphL Posted September 1, 2005 Posted September 1, 2005 When you define the button there is a box near the bottom of the dialog box where you enter the script parameter for that button.
VICH Posted September 1, 2005 Author Posted September 1, 2005 i know that part...but how do you define the set field to look for the script parameter
comment Posted September 1, 2005 Posted September 1, 2005 In Set Field, the target field cannot be specified by calculation. Maybe in version 9...
VICH Posted September 1, 2005 Author Posted September 1, 2005 do you have any alternative courses of action?
RalphL Posted September 1, 2005 Posted September 1, 2005 OK, I see the problem. Here is a test script that works: If [ IsEmpty ( GetField ( Get ( ScriptParameter ) ) ) ] Show Custom Dialog [ Title: "Empty"; Message: "Field is Empty"; Buttons: "OK" ] Set Field [ SetField::TextField; "X" ] Else Show Custom Dialog [ Title: "Not Empty"; Message: "Field is Not Empty"; Buttons: "OK" ] Set Field [ SetField::TextField; "" ] End If It looks like you will have to hard code the set field's. You can use an IF [Get ( ScriptParameter ) ) = "FiledName" to select wich setfield to use.
comment Posted September 1, 2005 Posted September 1, 2005 There is a workaround which I don't particularly like, that involves a loop using the Go to Next Field step (you need to be on a layout with all relevant fields included in the tab order). You exit the loop if Get (ActiveFieldName) = Get (ScriptParameter), then use SetField without specifying the target field. This sort of thing shouldn't be normally necessary, and the need for it usually signifies bad data structure.
VICH Posted September 1, 2005 Author Posted September 1, 2005 well i just have to play around with it some more and see
Recommended Posts
This topic is 7025 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