Navigation: Scripting Reference Manual > Functions & Subroutines > GetPickupCount

 

GetPickupCount

 

Contact Us: fredsupport@photonengr.com

 

Description

This command returns the number of entries in the pickup parameters list.

 

 

Syntax

pCount = GetPickupCount(  )

 

 

Parameters

pCount (Long)

Returned number of entries in the pickup parameters list.  The maximum index in the pickup parameters list is then pCount-1.

 

 

Example

This example loops over all pickups and prints their definitions to the output window. A separate subroutine is used to handle the formatting of the Script member of the T_PICKUP structure in the case where the Function member is "(user script)".

 

Sub Main

 

    ClearOutputWindow

 

    Dim pCount As Long

    pCount = GetPickupCount()

 

    Dim tPick As T_PICKUP

    Dim curPick As Long

    For curPick = 0 To GetPickupCount()-1

        GetPickup( curPick, tPick )

        Print "Pickup Description: " & Chr(9) & tPick.Description

        Print Chr(9) & "Active: " & Chr(9) & tPick.active

        Print Chr(9) & "Destination:" & Chr(9) & "[" & tPick.dstentity & "]" & Chr(9) & GetFullName(tPick.dstentity)

        Print Chr(9) & Chr(9) & "Index:" & Chr(9) & tPick.dstindex

        Print Chr(9) & Chr(9) & "Sub-index:" & Chr(9) & tPick.dstsubindex

        Print Chr(9) & Chr(9) & "Type:" & Chr(9) & tPick.dsttype

        Print Chr(9) & "Source:" & Chr(9) & "[" & tPick.srcentity & "]" & Chr(9) & GetFullName(tPick.srcentity)

        Print Chr(9) & Chr(9) & "Index:" & Chr(9) & tPick.srcindex

        Print Chr(9) & Chr(9) & "Sub-index:" & Chr(9) & tPick.srcsubindex

        Print Chr(9) & Chr(9) & "Type:" & Chr(9) & tPick.srctype

        Print Chr(9) & "Function:" & Chr(9) & tPick.Function

        Print Chr(9) & "Operation:" & Chr(9) & tPick.op

        Print Chr(9) & "Parameter A:" & Chr(9) & tPick.parma

        Print Chr(9) & "Parameter B:" & Chr(9) & tPick.parmb

        If tPick.Script <> "" Then

            printScript( tPick.Script )

        Else

        Print Chr(9) & "Script:" & Chr(9) & "None"

        End If

        Print ""

    Next curPick

 

End Sub

 

Sub printScript( ByVal pickScript As String )

 

    Print Chr(9) & "Script: "

 

    Dim vals() As Double

    Dim strs() As String

    Dim numTokens As Long, curLine As Long

    numTokens = ParseString( pickScript, Chr(10), vals(), strs() )

    For curLine = 0 To UBound( strs,1 )

        Print Chr(9) & Chr(9) & strs( curLine )

    Next curLine

 

End Sub

 

See Also

Pickup Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC