Function in For Next Loop


use a function in a For next loop, the loop does not wait until the function returns the value. I don’t understand. I mainly program with in Visual Studio, where the loop is interrupted when the function is called. What should I take into account? the loop breaks at:

Uncaught TypeError: Cannot read properties of undefined (reading ‘coinpair’)

→ without the function the error does not occur.

Here is my Code:

For lintLoop = 0 To UBound(lDynCoinList)
      If Not IsNull(CStr(lDynCoinList[lintLoop].coinpair)) Then
        If CStr(lDynCoinList[lintLoop].coinplatform) = "MexC" Then
          lintArrayIndex = Get_Array_Index(lDynCoinMexC, CStr(lDynCoinList[lintLoop].coinpair))
          If lintArrayIndex <> -1 Then
            lstrAktuellerKurs = CStr(lDynCoinMexC[lintArrayIndex].price)
          End If  
        End If
        CoinList.addItem(CStr(lDynCoinList[lintLoop].coinpair) & "  /  " & lstrAktuellerKurs)
      End If

Function Get_Array_Index(lDynCoin, lstrCoinName)
  For lintLoop = 0 To UBound(lDynCoin)
    If UCase(CStr(lDynCoin[lintLoop].symbol)) = UCase(lstrCoinName) Then
      Get_Array_Index = lintLoop
      Exit Function
    End If
  Get_Array_Index = -1
End Function

kind regards


Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)

  1. Which statement is it flagging with that error?

  2. Have you checked the values of all the interim values? I don’t see any asynchronous functions here, so it seems to be something in your code.

Uncaught TypeError: Cannot read properties of undefined (reading ‘coinpair’)
at Button2.onclick (code.js:44:54)

Hello George

for the async function i need the newest App Studio Version?Right, i have still V Can i have a upgrade with my key?

thanks for your answer


I’m not sure I understand your question here.

Version is many years old and no longer supported. You can get the latest version (9.0.2) here.


Is the price for 99$ still available with my Key. I can’t find it on the Website.

Freundliche Grüsse

Ramon Diriwächter


Seebergstr. 1

8952 Schlieren



Fon: +41 79 7494942

Your best bet the Essential Plan for $15/month subscription. You can also get Pro plan which has extra support.

Let me know if you have questions!