Navigation: Scripting Reference Manual > Functions & Subroutines > GetPickup

 

GetPickup

 

Contact Us: fredsupport@photonengr.com

 

Description

This command retrieves the specified entry in the pickup list and stores the definition in a T_PICKUP data structure.

 

 

Syntax

GetPickup pickupIndex, tPickup

 

 

Parameters

pickupIndex As Long

Index (0 based) into the pickup list whose data is being retrieved.

 

tPickup As T_PICKUP

Data structure containing the definition of the pickup entry at the index given by the pickupIndex parameter.

 

 

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

T_PICKUP

 

 

 

 

 

Copyright © Photon Engineering, LLC