I realized after sending that there should be 2 parameters not one form event, and current form page rather then checking the form page inside the project method.
On Thu, 11 May 2017 14:31:06 -0400, Chip Scheide via 4D_Tech wrote: > no, only the script in the button you clicked should run. > > BUT why not 1 button, on page zero? it is simpler to mange > only one bit of code to handle, and if there are parts of the code > which are identical you can have that code existing in only one place, > making updates or changes simple. AND by having the code for the button > in a project method you can test easier, AND you can call the code > without having to have the window open, the form loaded or generate a > click event! > > > Something like this (all typed in email - not fit for consumption as > code) : > // button script > ModuleName_New_Record (Form event) > > > // project method : ModuleName_New_Record > c_longint($1;$Form_Event) > > $Form_Event:=$1 > $Current_Page:=Current form page > > case of > :(Form_Event = on clicked) > case of > :(Current_Page=1) > //do stuff 1 > :(Current_Page=2) > //do stuff 2 > :(Current_Page=3) > //do stuff 3 > :(Current_Page=4) > //do stuff 4 > end case > end case > On Thu, 11 May 2017 19:05:03 +0100, Peter Mew via 4D_Tech wrote: >> Hi >> I have a form with 4 pages. >> each page has a button to create a new record. >> Each button also does some slightly different stuff depending which page >> its on. >> Which is why there is a button on each page, rather than a single button on >> Page 0 >> All the buttons have the variable name bNewRecord. >> My question is: >> If I click the button on page 1, will the scripts under the buttons on >> pages 2,3 & 4 run as well. >> All the buttons have "If(Form event = on clicked)" as part of the code >> >> thanks >> -pm >> ********************************************************************** >> 4D Internet Users Group (4D iNUG) >> FAQ: http://lists.4d.com/faqnug.html >> Archive: http://lists.4d.com/archives.html >> Options: http://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:[email protected] >> ********************************************************************** > --------------- > Gas is for washing parts > Alcohol is for drinkin' > Nitromethane is for racing > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** --------------- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

