ArcPad Scripting Object Model
GetProfileString Method
See Also  Example  Send comments on this topic.
Section
Required. A String that specifies the Section containing the entry.
Entry
Required. A String that contains the Entry whose string is to be retrieved.
Default
Optional. A String that specifies the Default value for the given entry if the entry cannot be found in the ArcPad.ini file.
Application Object : GetProfileString Method

Glossary Item Box

Description

Retrieves the string associated with an entry within the specified section in the ArcPad.ini file (on desktop Windows) or ArcPad's registry entry (on Windows CE).

Syntax

object.GetProfileString ( Section, Entry [,Default] )

Parameters

Section
Required. A String that specifies the Section containing the entry.
Entry
Required. A String that contains the Entry whose string is to be retrieved.
Default
Optional. A String that specifies the Default value for the given entry if the entry cannot be found in the ArcPad.ini file.

Return Type

String

Remarks

The return value is the string from the ArcPad.ini file or the string specified in the Default argument if the entry cannot be found. If the Default argument is not specified, the return value is an empty string.

Example

ApplicationProfile stores and retrieves entries in ArcPad's application profile.
Application Example (VBScript)Copy Code
Sub ApplicationProfile
  Dim strSection, strStringItem, strIntItem
  strSection = "My Section"
  strStringItem = "My String Item"
  strIntItem = "My Int Item"

  'Write a string value to ArcPad.ini
  Call Application.WriteProfileString(strSection, strStringItem, "test")

  'Retrieve the string value
  Dim strValue
  strValue = Application.GetProfileString(strSection, strStringItem)
  'Display the value retrieved
  MsgBox strValue

  'Write an integer value to ArcPad.ini
  Call Application.WriteProfileInt(strSection, strIntItem, 60)

  'Retrieve the integer value
  Dim intValue
  intValue =Application.GetProfileInt(strSection, strIntItem)
  'Display the value retrieved
  MsgBox intValue
End Sub

See Also

© 2013 All Rights Reserved.