Menu

user functions

'user defined func by nOOb

 type interp_variable
        string vname
        int vartype  ' 0 is a number and 1 is a string       
        string vscope ' this is a string that will identify where the variable can be accessed     
        ' if type is number then we will use n_value
        ' if type is a string then we will use s_value
        string s_value
        float n_value
  end type

    interp_variable  user_variables[99] ' all the variables in the program
    int user_variables_count = 0

  type interp_function   
        string name       
        int args[99]    ' each arg will be a number for the index in the user_variables array
        int args_count  ' number of arguments in the function     
        int token_pos   ' the token position to jump to for this function,
                        ' it will be the token after the function is made
  end type

    interp_function  user_functions[99] ' all the functions in the program
    int user_functions_count = 0 
Posted by Zlatko Vidlanovic 2023-08-20

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.