# devide and variables

## Recommended Posts

How do we divide a nil value?

even 0 is a value and you still get 0 when divide with any numbers.

##### Share on other sites

1 minute ago, zam535582 said:

How do we divide a nil value?

even 0 is a value and you still get 0 when divide with any numbers.

that's why i had the problem, x was supposed to be whatever the result was and then divide through 3...only problem is actually its a group search...that's why x was supposed to be nil..it was supposed to take whatever was gone be in the results..am i explaining correct to you?

##### Share on other sites
Posted (edited)
Quote

search1= 30

x = x/3

gg.searchNumber(search1, gg.TYPE_FLOAT)

a = gg.getResults(8000)

gg.editAll(x, gg.TYPE_FLOAT)

gg.clearResults()

You search for number 30.

results will show values with 30 only.

then edit with x value??

where the x is coming from??

Edited by zam535582

##### Share on other sites

it has to be  group search, if i have to type every value down and edit them 1 by 1 it wont be productive for future parts of the scripts.

X was supposed to be the function to edit the results.

if i put "x" instead of the value it was supposed to mean that after

gg.getResults(100)

X would then take those results and divide it through 3.. from there x = x/3

##### Share on other sites
Posted (edited)
```function X(value,range)
local value, range = value, range;
local code = value .. ";" ;
local next = value/ 3;
local previous = next;
code = code .. next .. ";" ;
for i = 1 , range-1 do
next = previous / 3;
code = code .. next .. ";" ;
previous = next;
end
code = code .. "::" .. tostring((range)* 4 + 1);
return code
end

-- Usage
x = X(30,2)
print(x)
-- output : 30;10;3::13```

Edited by ItsSC

##### Share on other sites
54 minutes ago, Haitiaan said:

X would then take those results and divide it through 3.. from there x = x/3

You better show full example with all numbers. For example for 10 rows. What you get from search, what you want receive as result and so on.

Because you use word "devide" with some sence only known for you.

##### Share on other sites
On 5/18/2020 at 8:31 PM, zam535582 said:

im a noob...really.

i try to search Google...What is x?

- The results could be anything in this whole universe.

so..we are playing a guessing game now?

quoting myself...