Not sure if I dreamed this up, but I think there was a way to make it possible to lookup certain parameters (e.g. sets, tables, indices etc.) in a UDF.
Is there?
Is there?
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
'ParameterHelp:Parameter1Name:UsersParameter1FunctiontoPopupHelp(pointer_to_current_function_parameter_values) 'ParameterHelp:Parameter2Name:UsersParameter2FunctiontoPopupHelp(pointer_to_current_function_parameter_values)
FUNCTION TestPrompt AS f (tablename AS C ) msgbox("tablename is", tablename) END FUNCTION
FUNCTION SelectLayout AS F (layoutname AS C ) msgbox("Selected Layout is", layoutname) END FUNCTION
'Date Created: 03-Oct-2008 08:54:53 AM 'Last Updated: 03-Oct-2008 09:01:50 AM 'Created By : Ira J. Perlow 'Updated By : Ira J. Perlow FUNCTION FunctionParameterPrompts AS C (Character_Parameter="" as C, Numeric_Parameter=0 as N) 'DESCRIPTION: This is the description popup line for FunctionParameterPrompts ' You may have to restart Alpha Five for the above to appear or to show current changes '========================================================================= ' Created by Computer Systems Design & Associates ' Created October 3, 2008 ' http://www.csda1.com '========================================================================= ' Sample inteactive usages ' ?FunctionParameterPrompts(" GlobalFunctionName", -5) ' ?FunctionParameterPrompts(" GlobalFunctionName", 4) ' ?FunctionParameterPrompts("GlobalFunctionName", -6) ' ?FunctionParameterPrompts("GlobalFunctionName", 7) ' ?FunctionParameterPrompts("GlobalFunctionName") ' ?FunctionParameterPrompts(" GlobalFunctionName") ' ?FunctionParameterPrompts(" ") ' ?FunctionParameterPrompts() ' Process input parameters dim chrprm as c IF Left(Character_Parameter,1)==" " ' A leading space on this parameter means we want to prompt for value chrprm=SUBSTR(Character_Parameter,2) ' Default value to use without leading space ' Prompt for Character Parameter starting with 2nd character. ' Normally a more extensive XDialog box chrprm=ui_get_list2("List Dialog",chrprm,a5.Udf_Enum(2),1) IF chrprm=="" EXIT FUNCTION ' Exit if dialog box was cancelled END IF ELSE IF Character_Parameter=="" ' Null parameter can be used to set default value, such as ' (DO ONLY 1 OF THE BELOW) '------------------------------------------------------ ' set to XYZ, chrprm="xyz" '------------------------------------------------------ ' leave as a null value "" chrprm="" '------------------------------------------------------ ' or do something special, e.g. display some help text dim HelpText as c HelpText=<<%text% This is Help Text for the function FunctionParameterPrompts To use this function...... %text% ui_msg_box("FunctionParameterPrompts",HelpText,UI_OK) EXIT FUNCTION '------------------------------------------------------ ELSE ' Otherwise use the parameter as given chrprm=Character_Parameter END IF dim numprm as n IF Numeric_Parameter<0 ' A negative number on this parameter means we want to prompt for value numprm=abs(Numeric_Parameter) ' Default value to use ' Prompt for Numeric Parameter ' Normally a more extensive XDialog box choice=ui_get_number("Number Dialog","Enter number",ltrim(str(numprm))) IF choice=="" EXIT FUNCTION ' Exit if dialog box was cancelled END IF numprm=val(choice) ' we could loop back to dialog if value is not valid ELSE IF Numeric_Parameter=0 ' Null parameter can be used to set default value, such as ' 5 ' leave as 0 value ' or do something special, e.g. display some help text numprm=0 ELSE ' Otherwise use the parameter as given numprm=Numeric_Parameter END IF ' Now do normal processing with modified values chrprm, numprm FunctionParameterPrompts="Function Name: "+chrprm+", Number: "+LTRIM(STR(numprm)) EXIT FUNCTION END FUNCTION
text_list = <<%list% asdf qwer zxcv %list% addin.function_argument_help( "MyTest", "Cals Test", [B][COLOR="Red"]"\""+[/COLOR][/B]text_list[B][COLOR="Red"]+"\""[/COLOR][/B], "Q", "" )
Comment