Jump to content
Sign in to follow this  
sloth85

While...Wend troubles

Recommended Posts

sloth85

While 1
    $currentLine = FileReadLine($SMDfile, $readStart+1+$s)
    If @error = -1 OR $currentLine = "end" Then ExitLoop
    
    If $StringMid($currentLine[1],1,1) = "/" OR $StringMid($currentLine[1],1,1) = ";" OR $StringMid($currentLine[1],1,1) = "#" Then
    ElseIf $lineID = 0 Then
        $lineID = 1
    Else
            $tempSplitLine = StringSplit($currentLine, " ", 1)
            $tempSearch = _A3DSearch($v, $tempSplitLine[2], $tempSplitLine[3], $tempSplitLine[4])
            
            If $tempSearch = -1 Then
                _Array2D_PutValue($v, $tempSplitLine[2] , UBound($v,1)-1, Default, 0)
                _Array2D_PutValue($v, $tempSplitLine[3] , UBound($v,1)-1, Default, 1)
                _Array2D_PutValue($v, $tempSplitLine[4] , UBound($v,1)-1, Default, 2)
                Redim $v[UBound($v,1)+1][3]
                _Array2D_PutValue($vn, $tempSplitLine[5] , UBound($vn,1)-1, Default, 0)
                _Array2D_PutValue($vn, $tempSplitLine[6] , UBound($vn,1)-1, Default, 1)
                _Array2D_PutValue($vn, $tempSplitLine[7] , UBound($vn,1)-1, Default, 2)
                Redim $vn[UBound($vn,1)+1][3]
                _Array2D_PutValue($vt, $tempSplitLine[8] , UBound($vt,1)-1, Default, 0)
                _Array2D_PutValue($vt, $tempSplitLine[9] , UBound($vt,1)-1, Default, 1)
                Redim $vt[UBound($vt,1)+1][2]
                $vcount = $vcount + 1
                
                $tempBcount = $tempSplitLine[10]
                $bcount[UBound($bcount,1)-1] = $tempBcount
                    If $tempBcount > 0 Then
                        For $i = 0 to $tempBcount-1
                            _Array2D_PutValue($bref, $tempSplitLine[11+(2*$i)] , UBound($bref,1)-1, Default,$i)
                            Redim $bref[UBound($bref,1)][UBound($bref,2)+1]
                            _Array2D_PutValue($w, $tempSplitLine[12+(2*$i)] , UBound($w,1)-1, Default, $i)
                            Redim $w[UBound($w,1)][UBound($w,2)+1]
                        Next
                    EndIf
                Redim $bcount[UBound($bcount,1)+1]
                Redim $bref[UBound($bref,1)+1][UBound($bref,2)]
                Redim $w[UBound($w,1)+1][UBound($w,2)]
                
                $faceIndices[UBound($faceIndices,1)-1] = $vcount-1
            Else
                $faceIndices[UBound($faceIndices,1)-1] = $tempSearch
            EndIf
            
            Redim $faceIndices[UBound($faceindices,1)+1]
            $fx3count = $fx3count+1
            
            If $lineID = 3 Then
                $lineID = 0
            Else
                $lineID = $lineID + 1
    EndIf
    $s = $s+1
Wend

results in:

Wend

Error: "Wend" statement with no matching "While" statement.

so i remove Wend just to try:

While 1
    $currentLine = FileReadLine($SMDfile, $readStart+1+$s)
    If @error = -1 OR $currentLine = "end" Then ExitLoop
    
    If $StringMid($currentLine[1],1,1) = "/" OR $StringMid($currentLine[1],1,1) = ";" OR $StringMid($currentLine[1],1,1) = "#" Then
    ElseIf $lineID = 0 Then
        $lineID = 1
    Else
            $tempSplitLine = StringSplit($currentLine, " ", 1)
            $tempSearch = _A3DSearch($v, $tempSplitLine[2], $tempSplitLine[3], $tempSplitLine[4])
            
            If $tempSearch = -1 Then
                _Array2D_PutValue($v, $tempSplitLine[2] , UBound($v,1)-1, Default, 0)
                _Array2D_PutValue($v, $tempSplitLine[3] , UBound($v,1)-1, Default, 1)
                _Array2D_PutValue($v, $tempSplitLine[4] , UBound($v,1)-1, Default, 2)
                Redim $v[UBound($v,1)+1][3]
                _Array2D_PutValue($vn, $tempSplitLine[5] , UBound($vn,1)-1, Default, 0)
                _Array2D_PutValue($vn, $tempSplitLine[6] , UBound($vn,1)-1, Default, 1)
                _Array2D_PutValue($vn, $tempSplitLine[7] , UBound($vn,1)-1, Default, 2)
                Redim $vn[UBound($vn,1)+1][3]
                _Array2D_PutValue($vt, $tempSplitLine[8] , UBound($vt,1)-1, Default, 0)
                _Array2D_PutValue($vt, $tempSplitLine[9] , UBound($vt,1)-1, Default, 1)
                Redim $vt[UBound($vt,1)+1][2]
                $vcount = $vcount + 1
                
                $tempBcount = $tempSplitLine[10]
                $bcount[UBound($bcount,1)-1] = $tempBcount
                    If $tempBcount > 0 Then
                        For $i = 0 to $tempBcount-1
                            _Array2D_PutValue($bref, $tempSplitLine[11+(2*$i)] , UBound($bref,1)-1, Default,$i)
                            Redim $bref[UBound($bref,1)][UBound($bref,2)+1]
                            _Array2D_PutValue($w, $tempSplitLine[12+(2*$i)] , UBound($w,1)-1, Default, $i)
                            Redim $w[UBound($w,1)][UBound($w,2)+1]
                        Next
                    EndIf
                Redim $bcount[UBound($bcount,1)+1]
                Redim $bref[UBound($bref,1)+1][UBound($bref,2)]
                Redim $w[UBound($w,1)+1][UBound($w,2)]
                
                $faceIndices[UBound($faceIndices,1)-1] = $vcount-1
            Else
                $faceIndices[UBound($faceIndices,1)-1] = $tempSearch
            EndIf
            
            Redim $faceIndices[UBound($faceindices,1)+1]
            $fx3count = $fx3count+1
            
            If $lineID = 3 Then
                $lineID = 0
            Else
                $lineID = $lineID + 1
    EndIf
    $s = $s+1
;Wend

and get

EndFunc

Error: "While" statement has no matching "Wend" statement.

WTF Edited by sloth85

Share this post


Link to post
Share on other sites
enaiman

You are missing an EndIf form the last If statement in the loop.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
sloth85

You are missing an EndIf form the last If statement in the loop.

Thanks! Works now. Wish it wouldve said missing EndIf rather than Wend.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.