Questions tagged [variable-length]

Refers to anything whose length can vary

Refers to anything whose length can vary

290 questions
-1
votes
1 answer

Incompatible type error when attempting to use variable length argument

I am attempting to use a variable length argument in my constructor, however I get the error messages: 'Incompatible types string cannot be converted to int' Illegal start of operation, ';' expected public class Personnel { private String…
czolbe
  • 571
  • 5
  • 18
-1
votes
3 answers

Access 2010: Pad (y) a variable string length (x) to a predetermined total so that x+y=55

I found plenty of advice on how to pad a string in Access 2010 but none on how to pad a variable length string with spaces out to a predetermined total string length. Example: Total length = 55, if string len = 15, then pad " " x 40 (15+40=55) if…
-1
votes
1 answer

What database or pseudo database should I use for variable data?

What is the best software or platform combination to use for storing variable data? My data is in standard name-value pairs. At the top of the tree are a few broad categories, each of which will have a name and a value (category name) and also may…
Chiwda
  • 1,233
  • 7
  • 30
  • 52
-1
votes
1 answer

Python (Length input to draw star with a center point of 0,0)

I have some code were the users input the length they want their star to be and then it draws out the star. What I am trying to accomplish here, is that every-time they make their input not only that it draws the star but it also keeps it centered…
-1
votes
3 answers

Want to know the length of a buffer C++

I am new to C++ and programming and I would like to know if there is a way to get the length of a pointer. Let's say Myheader is a struct with different types of data inside. My code goes like this: char *pStartBuffer; memcpy(pStartBuffer,…
Ouss
  • 11
  • 1
  • 2
-1
votes
1 answer

SQL variable type for table id

Usually when I need an ID for a database table, I just declare it as UNSIGNED INT, but what is the maximum value for this kind of ID? How can I know it? I'm using mysql server, but i think it would be useful to get an answer for all platforms. If…
Ben
  • 3,989
  • 9
  • 48
  • 84
-1
votes
1 answer

jquery variable .length :visible always returns 0?

Ok I have a variable checking for visible divs on page then getting the length but it always returns 0 why? this is my html structure:
vimes1984
  • 1,684
  • 3
  • 26
  • 59
-2
votes
3 answers

How to display none if div tag doesn't exist?

If the "slick-initialized" div tag doesn't exist within a parent, then I want the parent ID (product recommender-recipe) to display none. Right now this is what I have set up: HTML is set up like this:
-2
votes
1 answer

I am writing a hangman style program but am having trouble checking if more than one character has been entered and the set word is guessed

I am using a while loop to check if the number of guesses is less than 10 and once 10 guesses has been made it will prompt you one last time to input the whole answer not just individual characters. I know you can use .length to check the length of…
-2
votes
3 answers

Cannot read property 'length' of null javascript

I'm trying to implement a slideshow feature (using W3schools howto) into a web page. However I keep getting the error "Cannot read property 'length' of null javascript" at line 3 and 22 of my code. I've tried implementing a check for…
Karolade
  • 1
  • 1
-2
votes
4 answers

Alert message when input is greater or lower than 16 digits

I have created this:
gdim
  • 203
  • 1
  • 4
  • 13
-2
votes
1 answer

Python - len(x) doesn't evaluate in parameters?

I'm coding a game where if the user provides a word, the game uses that word. Otherwise, the program should pick a random word from the dictionary. Dictionary is a global list. Currently, the default random will always evaluate to 0, but evaluates…
-2
votes
1 answer

Assignment in list slice in Python

For example: x = [0] * 10 x[2:8] = [1] * 2 the result becomes: [0,0,1,1,0,0] Why is that happening? I didn't change the length of x but it automatically changed into 6. Moreover, the assignment is assign to the middle part of the x list, could…
-3
votes
2 answers

How do I read this "for-loop" code from freecodecamp

this is basically the code, I already got the right answer but I'm just trying to figure out how the process work total = 20 var myArr = [ 2,3,4,5,6]; var total = 0; for (var d = 0; d < myArr.length; d++){ total += myArr[d]; …
-3
votes
1 answer

Javascript var length off when it ends in 00

I am formatting the phone field. I get the value of the element and check to see if it 3 characters. The problem comes when the value ends with two zeros. The length of the var is off if it ends in two zeros. Example: 120 value comes in at 3 1200…
Jay
  • 1
  • 1
1 2 3
19
20