If I add "Byref" to the function header my function breaks down.
Here is the WORKING function header (aka without BYREF)
If I use the above function header the parameters/Dates come in fine.
Now if I use this function header the parameters/Dates do not come in succesfully.
Now I am using a version of A5v7 that isn't the latest. I am using Ver 7 build 4035. I doubt that has anything to do with it but I will mention it just in case.
Here is the full function definition (It just gets a date range from a user):
Any ideas :)
Here is the WORKING function header (aka without BYREF)
Code:
FUNCTION GetDateRangeFromUser AS L ( StartingDate_par AS D, EndingDate_par AS D )
Now if I use this function header the parameters/Dates do not come in succesfully.
Code:
FUNCTION GetDateRangeFromUser AS L ( byref StartingDate_par AS D, byref EndingDate_par AS D )
Here is the full function definition (It just gets a date range from a user):
Code:
FUNCTION GetDateRangeFromUser AS L ( byref StartingDate_par AS D, byref EndingDate_par AS D ) 'just gets a starting and ending date from the user and returns True if they put in a valid dates and the start date is 'before the ending date. If the user presses cancel or close then we return False DIM ButtonPressed as C debug(1) Get_Date: ok_button_label = "&OK" cancel_button_label = "&Cancel" ButtonPressed = ui_dlg_box("Enter Date Range",<<%dlg% {region} Enter Starting Date:| [%DATE%.20StartingDate_par!StartingDate_par_*]; Enter Ending Date:| [%DATE%.20EndingDate_par!EndingDate_par_*]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% if left(a_dlg_button,17) = "StartingDate_par_" then if a_dlg_button = "StartingDate_par_killfocus" then StartingDate_par = ctod(dtoc(StartingDate_par)) end if a_dlg_button = "" end if if left(a_dlg_button,15) = "EndingDate_par_" then if a_dlg_button = "EndingDate_par_killfocus" then EndingDate_par = ctod(dtoc(EndingDate_par)) end if a_dlg_button = "" end if %code%) IF ButtonPressed <> "OK" then GetDateRangeFromUser = .F. end end if IF EndingDate_par = {//} .OR. StartingDate_par = {//} then ui_msg_box("Error","You must enter both a starting and ending date.",UI_STOP_SYMBOL+UI_OK) goto Get_Date end if IF EndingDate_par - StartingDate_par < 0 then ui_msg_box("Error","Ending date must be after the starting date. Please try again",UI_STOP_SYMBOL+UI_OK) goto Get_Date end if GetDateRangeFromUser = .T. end END FUNCTION
Comment