Interface Functions

Note: Edit View is not supported. When a connection is established and SKY Index is in Edit View, the program will be automatically changed to Data Entry View.

Establishing and Closing a Connection to SKY Index

RequestConnection() as Boolean

Description

Requests a connection with SKY Index.

Returns

(Boolean) True if a connection was established. False if a connection could not be established.

CloseConnection() as Boolean

Description

Tells SKY Index that a connection is no longer needed.

Returns

(Boolean) True if a connection was closed. False if the connection was not closed (if an error occurs).

Navigation

FirstRow() As Long

Description

Moves the grid marquee to the very first row of the grid. The marquee stays in the same column.

Returns

(Long) The record number of the row after the function completes.

LastRow() As Long

Description

Moves the grid marquee to the very first row of the grid. The marquee stays in the same column.

Returns

(Long) The record number of the row after the function completes.

PreviousRow() As Long

Description

Moves the marquee up one row. The marquee stays in the same column.

Returns

(Long) Record number of row after function completes.

NextRow() As Long

Description

Moves the marquee down one row. The marquee stays in the same column.

Returns

(Long) Record number of row after function completes.

FirstCell() As Long

Description

Moves the marquee to the first grid cell (the Main heading cell).

Returns

(Long) Field number of the column after the function completes.

Notes

Field numbers are as follows: 2 = Main, 3=Sub1, 4=Sub2, etc. 12 = Page, 17=DateCreated, 18=DateEdited, 19=CreatorInitials, 20=EditorInitials.

LastCell() As Long

Description

Moves the marquee to the last grid cell (usually the Page cell).

Returns

(Long) Field number of the column after the function completes.

Notes

Field numbers are as follows: 2 = Main, 3=Sub1, 4=Sub2, etc. 12 = Page, 17=DateCreated, 18=DateEdited, 19=CreatorInitials, 20=EditorInitials.

NextCell() As Long

Description

Moves the marquee to the next grid cell (equivalent to pressing Tab)

Returns

(Long) Field number of the column after the function completes.

Notes

Field numbers are as follows: 2 = Main, 3=Sub1, 4=Sub2, etc. 12 = Page, 17=DateCreated, 18=DateEdited, 19=CreatorInitials, 20=EditorInitials.

PreviousCell() As Long

Description

Moves the marquee to the previous grid cell (equivalent to pressing Shift+Tab)

Returns

(Long) Field number of the column after the function completes.

Notes

Field numbers are as follows: 2 = Main, 3=Sub1, 4=Sub2, etc. 12 = Page, 17=DateCreated, 18=DateEdited, 19=CreatorInitials, 20=EditorInitials.

GotoRecord(RecordNumber As Long) as Boolean

Description

Moves the grid marquee to the row containing the record number specified. The marquee stays in the same column.

Returns

(Boolean) True if the record was found. False if the specified record could not be located.

GetFirstRowRecNo() As Long

Description

Returns the record number of the first record in the data entry grid.

Returns

(Long) The record number of the first row of the data entry grid.

Notes

This function has no effect on the active record in the data entry grid.

GetLastRowRecNo() As Long

Description

Returns the record number of the last record in the data entry grid.

Returns

(Long) The record number of the last row of the data entry grid.

Notes

This function has no effect on the active record in the data entry grid.

CurrentRowStatus

CurRowRecNo() As Long

Description

Returns the record number for the current row.

Returns

(Long) The record number for the current row.

CurRowCreator() As String

Description

Returns the creator initials for the current row.

Returns

(String) The creator initials for the current row.

CurRowEditor() As String

Description

Returns the editor initials for the current row.

Returns

(String) The editor initials for the current row.

CurRowDateCreated() As String

Description

Returns the date created for the current row.

Returns

(String) The date created for the current row.

CurRowDateEdited() As String

Description

Returns the date edited for the current row.

Returns

(String) The date edited for the current row.

Data Entry and Editing

AddRow(Entry as String, Locator as String) As Long

Description

Adds a new entry to the index.

Parameters

Entry is a tab delimited string. Each subheading is delimited from the previous heading by a tab.

Locator is a string value that represents the locator for the new entry.

Returns

(Long) Record number of row after function completes.

DeleteCurRow() as Long

Description

Deletes the current row of the data entry grid.

Returns

(Long) The new current row’s RecNo.

Notes

Special care must be taken when deleting a row within a loop that steps through the data entry grid. The current row will by necessity change after this operation. In addition, the RecNo for the first row and/or the last row can change. This can potentially cause an endless loop if your code does not requery GetLastRowRecNo each time the loop executes. Your loop may also skip a row after deleting if it is not properly constructed.

GetCellFieldNo() As Long

Description

Returns the field number of the grid cell that currently has the grid marquee.

Returns

(Long) The field number of the grid cell with the marquee.

Notes

Field numbers are as follows: 2 = Main, 3=Sub1, 4=Sub2, etc. 12 = Page, 17=DateCreated, 18=DateEdited, 19=CreatorInitials, 20=EditorInitials.

This function has no effect on the current (active) record or cell in the data entry grid.

GetCellText() as String

Description

Retrieves the text from the grid cell that is currently highlighted by the marquee.

Returns

(String) The current cell’s text.

PutCellText(NewText as String) As Long

Description

Replaces the text of the grid cell that is currently highlighted by the marquee with new text.

Parameters

NewText (String) – the text to be put into the grid’s cell.

Returns

(String) The current cell’s text. NOTE: If this does not match the text you specified to be ‘put’, the operation failed.

GetEntry() as String

Description

Retrieves the entry text from the current grid row. NOTE: An entry includes all subheadings. Each subheading is separated from the previous subheading by a tab.

Returns

(String) The current row’s entry text.

PutEntry(Entry as String) As Boolean

Description

Replaces the entry text of the current grid row with new entry text. NOTE: An entry includes all subheadings. Each subheading is separated from the previous subheading by a tab.

Parameters Entry (String) A tab delimited string that represents the entry. It has the form: Main {tab} Sub1 {tab} Sub2 {tab}, etc. You do not need to include tabs for trailing subheadings that contain no text. For example "My main{tab}My sub" is a legal 'Entry'.

Returns

(Boolean) True if the the operation succeeded and False if it failed.

GetLocator() as String

Description

Retrieves the locator (page) text from the current grid row.

Returns

(String) The current row’s locator (page) text.

PutLocator(NewLocator as String) As Boolean

Description

Replaces the locator (page) of the current row in the grid.

Parameters

NewLocator (String) – the text to be put into the grid’s locator (page) cell.

Returns

(Boolean) True if the the operation succeeded and False if it failed.

GetLabel() As Long

Description

Returns the label number of the current row.

Returns

(Long) The label number of the current row.

Notes

The number returned is between 0 and 9. If 0 is returned, it means no label has been assigned. If 1-9 is returned, it is the label number that has been assigned to the row.

PutLabel(Label as Long) As Boolean

Description

Labels the current row of the data entry grid with the specified label.

Parameters

Label (Long) – the label to be applied to the current row of the grid. The valid range for this number is 0-9. Any other number will be ignored.

Returns

(Boolean) True if the the operation succeeded and False if it failed.

Notes

Setting the Label to zero removes all labeling from the current row.

Grid View (Sort Order/Filtering/Grouping)

GetSortOrder() As siSortOrders

Description

Returns the data entry grid’s current sort order.

Returns

(siSortOrders) Returns the current sort order.

soAsEntered – The grid is in As Entered order

soSorted – The grid is in Sorted order

soPageOrdered – The grid is in Page Ordered order

 

GroupOnRecNos(RecNos as String) As Boolean

Description

Creates a group out of a comma delimited string of record numbers.

Parameters

RecNos (String) A comma delimited list of record numbers to group on. Note: Use a single comma, not a comma plus a space.

Returns

(Boolean) Returns True if the function succeeded, False if not.

NOTES

 

SetSortOrder(SortOrder As siSortOrders, MaintainGroup as Boolean) As Boolean

Description

Put the data entry grid into the specified sort order.

Returns

(Boolean) Returns True if the function succeeded, False if not.

Parameters

SortOrder (siSortOrders) – The desired sort order soAsEntered, soSorted, or soPageOrdered

MaintainGroup (Boolean) – If set to true, the current group, if any, will be maintained when switching the sort order. Otherwise, the grid will be ungrouped prior to changing the sort order.

Index

Backup(Path as String) As String

Description

Backs up the current index.

Parameters

Path – If not an empty string, the specified path (which must include a filename) will be used for the backup. If Path is an empty string, SKY Index will present a dialog to the user asking for a filename for the backup and the name that the user specified, along with the path, will be returned.

Returns

(String) Path of the backup file or an empty string if an error occurred.

Notes If you provide a filename, it is used exactly as-is. No filename extension is added. We recommend that you use ".sk7backup", but you can use whatever extenstion you wish.

SKY Software recommends that if your add-in modifies a large amount of data that you first backup the index using this function. Even though SKY Index has an Undo function, many customers are unaware of it and if they close the index before using it, the undo information is lost. This function is very fast and does not add a significant amount of time to the operation of your add-in.

BackupPath() As String

Description

Returns the path to the folder used by SKY Index to store backup files.

Returns

(String) The full path (including a trailing backslash) to the folder used by SKY Index for storing backups.

 

GenerateIndex() As String

Description

Generates the index according to the current index settings and returns the full path and filename of the file that was generated.

Returns

(String) The full path and file name of the file that SKY Index generated. Returns an empty string if the index could not be generated.

IndexPath() As String

Description

Returns the path to the folder used by SKY Index to store both indexes and generated output files.

Returns

(String) The full path (including a trailing backslash) to the folder used by SKY Index for storing indexes.

Subheadings() As Long

Description

Returns the number of subheadings defined for the currently open index.

Returns

(Long) The number of subheadings defined for the currently open index. (0=no subheadings)

IndexRows Collection

CommitRowChanges(UndoCaption as String) As Boolean

Description

Commits any changes you've made to the IndexRows collection to disk.

Parameters

UndoCaption (String) The text that will appear in the Edit Menu's Undo menu item after this function has finished updating the index with your changes.

Returns

(Boolean) True if the commit succeeded without errors, False if not.

Notes

When you modify rows in the IndexRows collection, those changes do not immediately get saved to disk. You must first call this function. All changes you've made will be commited to disk and then the IndexRows collection will be updated to reflect any deleted records in the index.

LoadIndexRows() As Boolean

Description

Loads the entire index into IndexRows collection in order to more quickly manipulate the data in the index. (You can avoid stepping through the index one grid row at a time by using this feature.) After calling this function, you can access all of the rows in the index through the IndexRows collection.

The IndexRows collection is essentially an array of Index Rows. Each member of the array is an IndexRow object. You can access them by referencing IndexRows with the array member in parentheses plus the field preceded by a period. For instance, IndexRows(1).Main contains the contents of the Main heading for row #1 and IndexRows(25).Page contains the contents of the Page field for row #25 and so on. You can also assign new values to most of these fields like this: IndexRows(1).Main = "My New Main".

Any changes you make will not appear in SKY Index until you call the CommitRowChanges function.

Returns

(Boolean) True upon success, False if an error occurred.

Notes

You can determine the row count with IndexRows.Count

The Heading property allows you to access the headings Main through Sub6 using an index 0 through 6. For example Heading(0) would return the main heading and Heading(3) would return Sub3.

The included fields are ([r]=readonly [r/w]=read/write):

Field Attributes
Record (String) [r]
Main (String) [r/w]
Sub1 (String) [r/w]
Sub2 (String) [r/w]
Sub3 (String) [r/w]
Sub4 (String) [r/w]
Sub5 (String) [r/w]
Sub6 (String) [r/w]
Page (String) [r/w]
Label (Long) [r/w]
Selected (Boolean) [r/w]
DateCreated (String) [r]
DateEdited (String) [r]
CreatorInitials (String) [r]
EditorInitials (String) [r]
Deleted (Boolean) [r/w]
Heading(Index) (String) [r/w]

Other

SetConfigForWordEmbed() As Boolean

Description

Sets the current index’s configuration so that it is compatible with WordEmbed.

Returns

(Boolean) True if the function succeeds, False is not.

Support Functions

StyledText class

The StyledText class allows you to manipulate styled text in a safe way. It is strongly recommended that you use this class in your Add-in

StyledText Class

Copyright ©, SKY Software. All Rights Reserved  ·  Last update: 11 Jan 2018   ·   Is there a problem with our website? Please report it to: Webmaster  ·  Every effort has been made to ensure accuracy, but we cannot be responsible for misprints.  ·  The SKY Software logo is a registered trademark of SKY Software.  ·  SKY Index is a trademark of SKY Software.  ·  Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.