Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/07/2018 in Posts

  1. Look like all ok.
    2 points
  2. Another option for your case is to use "return" statement in "if" block, so that remaining part of the function won't be executed when the condition is met. if gg.getResultCount() ~= 3 then zabissk() return end -- Remaining part of the function
    2 points
  3. alright, thank you guys for the info, I found everything I need, I only need to relook that part what ENBY said, I think I kind of get what you mean tough but still need to test out. solution for my if statement is like this :): function _____________________________() gg.clearResults() gg.searchNumber('450.0;1.04719758034;-300.0', gg.TYPE_FLOAT) if gg.getResultCount() ~= 3 then zabissk() else gg.searchNumber('450.0;1.04719758034;-300.0', gg.TYPE_FLOAT) t = gg.getResults(3) t[1].value = '50' t[1].freeze = true t[1].freezeType = gg.FREEZE_NORMAL print('addListItems: ', gg.addListItems(t)) gg.clearResults() gg.setRanges(gg.REGION_CODE_APP) gg.searchNumber('1.294621e-38F;0.10000000149F', gg.TYPE_FLOAT) r = gg.getResults(2) r[2].value = '-0.7' gg.setValues(r) end end function zabissk() gg.setRanges(gg.REGION_CODE_APP) gg.searchNumber('1.294621e-38F;0.10000000149F', gg.TYPE_FLOAT) r = gg.getResults(2) r[2].value = '-0.7' gg.setValues(r) gg.clearResults() gg.toast('You Tube = Dragon Star') end
    1 point
  4. Of course it can, but using functions is a way better approach than goto in my opinion. You can read more about goto statement and it's negative sides here. https://en.wikipedia.org/wiki/Goto
    1 point
  5. Go to is bad. And go to to other function can lead to unpredictable things or not work at all.
    1 point
  6. Function call is not a go to. If you do not run other part code you must use else block of the if. And use indentation will be good for easy read code. if gg.getResultCount() ~= 3 then zabissk() else -- other code end
    1 point
  7. Got some work to still do... But looks very promising.
    1 point
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.