IDArrayOfSelectedAddresses As String()

 

Returns a String array containing the IDs of selected addresses in ListboxAddresses.

 

 

Returns:

 

Type

Value

Description

String

array

Array of type String, containing the contents of column id of table addresses. The record IDs of all address records selected in ListboxAddresses, of Databox in WindowMain.

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

 Used in:

 

XojoScript Name

GUID

Print Addresslist in Word

A0503557-7DB7-4CC0-B08B-31005A0B1879

 

Hint: You can find more references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%IDArrayOfSelectedAddresses%'

 

Example XojoScript:

 

// print addresslist, from addresslist

Dim arID() As string

Dim numRecs As Integer

 

arID = IDArrayOfSelectedAddresses

 

// Retrieve the index of the last element in the array arID.

numRecs = Ubound(arID)

 

Dim idStr As String

idStr = Join(arID,",")

 

Dim sql As String

sql = "SELECT Gender, Linkbox As 'Name'," _

+ "PostalCode,City,Country,Language As 'Lg'," _

+ "EmailAddress As 'Email',DirectPhone As 'Phone' " _

+ "FROM " + GetPrefix + "addresses WHERE id IN (" + idStr + ") " _

+ "ORDER BY LastName, FirstName"

 

Dim Records() As String

Dim FieldDelimiter As String = "**"

 

// Store Results in Array

Records = SQLSelect(sql,FieldDelimiter)

 

// Proceed if we have received any records

If Ubound(Records) > -1 Then

 

// If we produced an error, the returning record

// starts with the String : "ERROR"

 

If Left(Records(0),5)="ERROR" Then

MsgBox Records(0// Display warning

 

Else

 

Dim ub As Integer = Ubound(records)

Dim i As Integer

Dim RecordDelimiter As String = "}{"  // Use a string not existing in your data

Dim vAmount As Double

Dim vTotal As Double = 0

Dim vTotalStr,vAmountStr,myList As String

 

For i = 0 To ub

 

// Make each Field of retrieved record a new record in myList

 

myList = myList + NthField(records(i),FieldDelimiter,1) + RecordDelimiter  // Gender

myList = myList + NthField(records(i),FieldDelimiter,2) + RecordDelimiter  // Name

myList = myList + NthField(records(i),FieldDelimiter,3) + RecordDelimiter  // Zip

myList = myList + NthField(records(i),FieldDelimiter,4) + RecordDelimiter  // City

myList = myList + Uppercase(Left(NthField(records(i),FieldDelimiter,5),3)) + RecordDelimiter  // Country

myList = myList + NthField(records(i),FieldDelimiter,6) + RecordDelimiter  // Language

myList = myList + NthField(records(i),FieldDelimiter,7) + RecordDelimiter  // Email

myList = myList + NthField(records(i),FieldDelimiter,8) + RecordDelimiter  // Phone

 

Next

 

// Now print list

DoScript("WordAddressList.scpt",myList,RecordDelimiter)

 

End If

End If