Most voted "function" questions
The function (also called procedure, method, subprogram, or routine) is a portion of code intended to perform a single, specific task.
Learn more…1,309 questions
Sort by count of
-
-1
votes2
answers62
viewsFind the longest word using . Sort()
Hello, I would like to be able to do a function to find the longest word among a set of words but only find codes that help to find the longest word within a sentence Follow the code I made function…
-
-1
votes2
answers29
viewsWhat is the difference at the time of the return of these two forms?
def seja_educado(funcao): def sendo(): print('Foi um prazer!') funcao() print('Tenha um ótimo dia!') return sendo def seja_educado(funcao): def sendo(): print('Foi um prazer!') funcao() print('Tenha…
-
-1
votes2
answers84
viewsHow do I get a given function to return the value of a date variable and a numeric one in php?
I created a function that calculates the next working day of a given date that it receives, but in addition to returning me this new date I wanted it to increment one number more than one counting…
-
-1
votes1
answer23
viewsReturn of an AJAX is not returning value in Function
I have a function that executes an AJAX, the AJAX response I return in the 'Return', but when I give a console.log the function returns I get no data. Below is the code. function getListEmployee() {…
-
-1
votes3
answers387
viewsI created a Python function, but it is not executed
I was studying about the Python language and, as a test, I played a game of Jokenpô. To make it restart, I saw that I would have to put it inside a function to eventually return to it and restart…
-
-1
votes1
answer36
viewsError in javascript code
I’m having an error in my course exercise someone can help me? (function(){ var mes = prompt("Deseja calcular quantos meses? [0 à 3]"); mes = parseFloat(mes); if(mes === 1){ function mes1(P,I){…
-
-1
votes1
answer184
viewsVariavel is not defined (Javascript)
function RemoverForro(valor){ var valorForro = valor; } $(add_button7).click(function(e){ e.preventDefault(); if(l < max_fields7){ l++; $(wrapper7).append( '<div id="tipo_forro_div_'+ l +'"…
-
-1
votes0
answers22
views(Python) Using a Private attribute in a subclass
My wish is to validate my IF in class B using a private attribute that was done in class A. Nothing more than that, I am aware of some methods to verify an anonymous attribute but still I could not,…
-
-1
votes1
answer72
viewsHow do I get variable values out of a function?
I have a function, name rounds, with another function inside, and in this function that ta inside I have a declared variable, it calls pecas_comp, i need it in function rounds but am not getting…
-
-1
votes1
answer2368
viewsHow to change input value within div with Avascript
I’ve even managed to change an input inside the div, but when I try to change the input of other div I can’t, I’ve tried several things and nothing. div1 <div class="container"> <div…
-
-1
votes1
answer665
viewsNameerror: name 'mostrar_urls' is not defined
Good afternoon! I’m trying to develop a project/idea I had, only when I went to put the "menubar" in other "parts of the programme" the program does not "whether" run further, can anyone help me…
-
-1
votes2
answers92
viewsPassing a vector to a function in C
In my C practices, I decided to practice using a vector through a function, using the method of passing by parameter. The goal of the program is to receive the 5 elements of a vector, then show the…
-
-1
votes1
answer1691
viewsConvert LONG column to VARCHAR2 in ORACLE - problem related to LONG column value size relative to VARCHAR2
CREATE OR REPLACE FUNCTION PRC_HAM_CONVT_LONG_VARCHAR2 ( p_owner VARCHAR2, p_tabela VARCHAR2, p_coluna VARCHAR2, p_rowid UROWID )RETURN VARCHAR2 IS v_cursor INTEGER; --cursor v_length INTEGER;…
-
-1
votes2
answers212
viewsC# How to make a string function execute active command?
I’m developing a C# project and I’m stuck in a mistake when it comes to moving from one form to another. The main form is called Main and the new Form1... well... I can send a variable string to…
-
-1
votes1
answer63
viewsWhy can I still access a variable in the heap even after the function is over?
A while ago I learned about heap and stack, I was testing some codes when I came across a strange behavior in heap see; #include <iostream> using namespace std; void Test1(int *i[]); void…
-
-1
votes1
answer27
viewsProblem with javascript function
To having a problem of "Uncaught Referenceerror: nameValue is not defined", being that the "nameValue", is being passed to function, so no idea of what the problem. Function : function…
-
-1
votes1
answer449
viewsReturn a string in C
Good morning, I want to return a word that is in a file,. #include <stdio.h> #include <stdlib.h> #include<locale.h> #include<string.h> int *abrir_arquivo(){ //o cursor ira…
-
-1
votes1
answer217
viewsAre there any devaluations of creating a component in React per function instead of Class?
There is a downside to creating the components in React by function instead of class? In the case of Class, the component does not need to have an ID to be accessed internally and change its…
-
-1
votes1
answer176
viewsInserting a PROCEDURE in query() in PHP
Guys, I’ve been trying for a while to integrate a project together with PHP, but when calling it, PHP keeps showing errors: Overview: $database = null; function Conecta($server, $user, $port, $bd){…
-
-1
votes1
answer72
viewsInsert/change data into a file?
I am developing a program that uses a function(insert) to which adds products and precise quantities that inputs are one at a time in a file. The part of the quantities would be in a function…
-
-1
votes1
answer940
viewsfunction that decides whether it can climb on a JAVASCRIPT toy
BS: I’m using a learning platform, I’m trying to decipher what’s wrong. I’ll leave the question below and my code. In the city amusement park, they installed a new roller coaster and asked us for…
-
-1
votes1
answer53
viewsPassage of variables from one function to another in Python
I’m having trouble passing variables n and m from the starting function to the function computador_escolhe_jogada. The error message itself points: Typeerror: computer_choice move() Missing 2…
-
-1
votes1
answer36
viewsFunction does not modify the Matrix after the second call!
I’m making a small game, however, I need to call this function 3 times, in the first call of the function it performs as expected, however, in the second and third call it does not do what I expect.…
-
-1
votes1
answer46
viewsProblem with Function Return, even returning false runs
Check it out, I have a code where the person type her number, check if the user exists or not, if yes, search his data, check if he has password or not, if you have goes to a page if you don’t have…
-
-1
votes1
answer410
viewsFunction does not recognize global variable in Javascript
When I use variables to store content from text boxes, to can execute in a function (just like it is in the code I left here), if the variables are not inside the function, the code does not work…
-
-1
votes4
answers140
viewsExercise: Quick replacement
Your mission now is to create a function called substituicaoRapida that you receive a text, a word to look for and the word that will replace the one you are looking for. The function should return…
-
-1
votes1
answer31
viewsError using class to filter by student names
I’m trying to do a function to search by student’s name in the databank. I’m having the following mistake: Notice: Undefined index: filter in C: meuphp test search_student.php on line 7 <?php…
-
-1
votes1
answer57
viewsvariable pass by reference between function in c
1) Create a program that has a character array. This vector must have a maximum size TAM = 10. No parameter can be global. The program must have: a. the main function, responsible for interacting…
-
-1
votes1
answer62
viewsReplace "Apostrophe" key when typed in mobile input
I am having a problem that I am not knowing the resolution when the system in question is accessed on mobile devices only. I have a TEXTAREA field so that users can write their data and consequently…
-
-1
votes1
answer152
viewsHow to call a pure java script function when unchecked and marked a checkbox?
How to do this in pure java script? because there is a need to change the values of an input when checkbox is checked and unchecked. I want basically that when checking the checkbox the values add…
-
-1
votes1
answer202
viewsHow to declare an array variable as global in PHP securely?
In the function below I receive a message that the form used is not safe... and even ignoring I am unable to collect the contents of the variable $a after function $a = array(); function teste1(){…
-
-1
votes2
answers167
viewsRun PHP function with onclick()
Hello, I have a function that should be executed only by clicking the filter button, but the page already opens with the search, with the function executed. Onclick is already on the filter button.…
-
-1
votes1
answer2281
viewsJavascript function - help
someone helps me in this activity, I do not understand and does not get in the head, I have not seen a good explanation. Now we ask you to declare a function called tripleDaSoma() that takes two…
-
-1
votes1
answer134
viewsError in call of Arrow function on button - React Native
I want to call the clearMemory function by the "AC" button but I’m not getting it. Follow the reference code: export default class App extends Component { state = { displayValue: '0', } addDigit = n…
-
-1
votes2
answers51
viewsHow do you use the console to display the X and Y position values of the mouse?
HTML <!DOCTYPE html> <html lang="pt-br"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script> <script…
-
-1
votes1
answer542
viewsHow to know how many times a word repeats in the array and,from the return of a function that calculates this,do new calculations?(JS)
I need to do a function that returns how many times the car board appears in the array and use this return in another function to determine a calculation. That’s my code and it’s printing "0" var…
-
-1
votes1
answer50
viewsSomeone could help me work struct with vectors and function, I’m not sure when to pass the data
typedef struct { int cod, num_hab; char sigla_esta[5], estado[30], cidade[30]; }Cidade; main() { //Variaveis Cidade cidades[max]; Estado estados[max]; Pais paises[max]; int op, i, posl, aux; int cc…
-
-1
votes1
answer65
viewsDynamic table with data coming from an input - js
Look, guys, all right? I created a function that prints the prime numbers according to the value entered by the user in the input. I’m having a hard time accessing this number so that the function…
-
-1
votes1
answer119
viewsJavascript: Problems running a function. How to improve code?
Hello, I am doing an introductory Javascript course and, although I can print the desired result of the exercise, the platform does not recognize my code. I would like you to help me improve the…
-
-1
votes1
answer72
viewsHow to classify a.csv file column without using PHP Sort functions?
I need your help to complete a college activity. I have to sort the rows of a.csv file according to one of the columns and display the result. I could use the array_multisort, but I need to write it…
-
-1
votes1
answer30
viewsHow to get value from a function that is within the other JS function
I got a problem. I have the following code with the proper credentials and I can’t return the value that returns in . then(result), I need to make it return a JSON in this function with all the…
-
-1
votes1
answer98
viewsFunction returning only one value
I am making a program in Python and need to implement a function. The function receives as input two parameters: A dictionary containing as key the name of an employee and as value a list containing…
-
-1
votes1
answer612
viewsFunction to calculate the average of two notes in python
I have difficulty creating two functions: one that calculates the average of 2 grades and another that tells in which situation the student is "approved", "failed", and "recovery". My code is giving…
-
-1
votes2
answers78
viewsPlace a condition on an exported function in Node.js
I’m having a pertinent question, I’m starting a project in Lectron where I have to make the connection with two different banks, one location and the other in clouds, in my Node js code, I have two…
-
-1
votes1
answer118
viewsDiscord.js is not expecting the return of the function
I am developing a BOT where I need to make a request (GET) for an API that returns me a JSON. This part is apparently working properly, I put this request in a separate file and created a function…
-
-1
votes1
answer46
viewsProblem executing function with While loop and If condition
I need to perform an exercise, which prompts a system that reads 20 numbers, then sums them up and then displays the result on the screen. The statement asks to use only While. So I made the code…
-
-1
votes1
answer42
viewsHow do I get two numbers typed by the user via form and send to a function that will pick a random value between them in React
At the moment my code is like this, but it’s very messy, although I think it’s possible to understand the intention. The question is: How do I get two numbers typed by the user via form and send to…
-
-1
votes1
answer38
viewshow it returns an array of a function
I want to take data from a SELECT array public function aluno($cod) { $cod = ""; global $pdo; $sql = $pdo->prepare("SELECT KS0042.CODALUNO, ks0300.ALUNO From KS0042 Inner Join KS0300 ON…
-
-1
votes1
answer58
viewsHow to make the Toastr message appear and only then run the page report?
Registration is successfully performed, but the Reload page before the Toastr message appears. // Função formulário de cadastro de Cliente function cadIndCliente(btnPropToggler) { // Variáveis…
-
-1
votes2
answers43
viewsSelect a specific JSON array with Javascript
I created a script with Axios to resume a call, then the result: [ { FieldId: 8095, FieldName: 'Nome1', FieldValueIds: [ 12059 ], FieldValues: [ '9.000' ], IsFilter: true, FieldGroupId: 99,…