xref: /AOO42X/main/helpcontent2/source/text/sbasic/shared/03103900.xhp (revision 4346dc92793f38d03de19166a29fd18a99ba3585)
1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
3226a8927SAndrew Rist<!--***********************************************************
4cdf0e10cSrcweir *
5226a8927SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
6226a8927SAndrew Rist * or more contributor license agreements.  See the NOTICE file
7226a8927SAndrew Rist * distributed with this work for additional information
8226a8927SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
9226a8927SAndrew Rist * to you under the Apache License, Version 2.0 (the
10226a8927SAndrew Rist * "License"); you may not use this file except in compliance
11226a8927SAndrew Rist * with the License.  You may obtain a copy of the License at
12cdf0e10cSrcweir *
13226a8927SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14cdf0e10cSrcweir *
15226a8927SAndrew Rist * Unless required by applicable law or agreed to in writing,
16226a8927SAndrew Rist * software distributed under the License is distributed on an
17226a8927SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18226a8927SAndrew Rist * KIND, either express or implied.  See the License for the
19226a8927SAndrew Rist * specific language governing permissions and limitations
20226a8927SAndrew Rist * under the License.
21cdf0e10cSrcweir *
22226a8927SAndrew Rist ***********************************************************-->
23226a8927SAndrew Rist
24cdf0e10cSrcweir<helpdocument version="1.0">
25cdf0e10cSrcweir<meta>
26cdf0e10cSrcweir<topic id="textsbasicshared03103900xml" indexer="include" status="PUBLISH">
27cdf0e10cSrcweir<title id="tit" xml-lang="en-US">FindPropertyObject Function [Runtime]</title>
28cdf0e10cSrcweir<filename>/text/sbasic/shared/03103900.xhp</filename>
29cdf0e10cSrcweir</topic>
30cdf0e10cSrcweir</meta>
31cdf0e10cSrcweir<body>
32cdf0e10cSrcweir<section id="findpropertyobject">
331832f669Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3146958">
341832f669Smseidel<bookmark_value>FindPropertyObject function</bookmark_value>
35cdf0e10cSrcweir</bookmark>
36*4346dc92Smseidel<paragraph role="heading" id="hd_id3146958" xml-lang="en-US" level="1" l10n="U"><link href="text/sbasic/shared/03103900.xhp" name="FindPropertyObject Function [Runtime]">FindPropertyObject Function [Runtime]</link></paragraph>
37*4346dc92Smseidel<paragraph role="paragraph" id="par_id3154285" xml-lang="en-US" l10n="U">Enables objects to be addressed at run-time as a string parameter using the object name.</paragraph>
38cdf0e10cSrcweir</section>
39*4346dc92Smseidel<paragraph role="paragraph" id="par_id3147573" xml-lang="en-US" l10n="U">For instance, the command:</paragraph>
40*4346dc92Smseidel<paragraph role="paragraph" id="par_id3145610" xml-lang="en-US" l10n="U">MyObj.Prop1.Command = 5</paragraph>
41*4346dc92Smseidel<paragraph role="paragraph" id="par_id3147265" xml-lang="en-US" l10n="U">corresponds to the following command block:</paragraph>
42*4346dc92Smseidel<paragraph role="paragraph" id="par_id3153896" xml-lang="en-US" l10n="U">Dim ObjVar as Object</paragraph>
43*4346dc92Smseidel<paragraph role="paragraph" id="par_id3148664" xml-lang="en-US" l10n="U">Dim ObjProp as Object</paragraph>
44*4346dc92Smseidel<paragraph role="paragraph" id="par_id3150792" xml-lang="en-US" l10n="U">ObjName As String = "MyObj"</paragraph>
45*4346dc92Smseidel<paragraph role="paragraph" id="par_id3154365" xml-lang="en-US" l10n="U">ObjVar = FindObject( ObjName As String )</paragraph>
46*4346dc92Smseidel<paragraph role="paragraph" id="par_id3148453" xml-lang="en-US" l10n="U">PropName As String = "Prop1"</paragraph>
47*4346dc92Smseidel<paragraph role="paragraph" id="par_id3150449" xml-lang="en-US" l10n="U">ObjProp = FindPropertyObject( ObjVar, PropName As String )</paragraph>
48*4346dc92Smseidel<paragraph role="paragraph" id="par_id3159152" xml-lang="en-US" l10n="U">ObjProp.Command = 5</paragraph>
49*4346dc92Smseidel<paragraph role="paragraph" id="par_id3156214" xml-lang="en-US" l10n="U">To dynamically create Names at run-time, use:</paragraph>
50*4346dc92Smseidel<paragraph role="paragraph" id="par_id3154686" xml-lang="en-US" l10n="U">"TextEdit1" to TextEdit5" in a loop to create five names.</paragraph>
51*4346dc92Smseidel<paragraph role="paragraph" id="par_id3150868" xml-lang="en-US" l10n="U">See also: <link href="text/sbasic/shared/03103800.xhp" name="FindObject">FindObject</link></paragraph>
52*4346dc92Smseidel<paragraph role="heading" id="hd_id3147287" xml-lang="en-US" level="2" l10n="U">Syntax:</paragraph>
53*4346dc92Smseidel<paragraph role="paragraph" id="par_id3149560" xml-lang="en-US" l10n="U">FindPropertyObject( ObjVar, PropName As String )</paragraph>
54*4346dc92Smseidel<paragraph role="heading" id="hd_id3150012" xml-lang="en-US" level="2" l10n="U">Parameters:</paragraph>
55*4346dc92Smseidel<paragraph role="paragraph" id="par_id3109839" xml-lang="en-US" l10n="U"><emph>ObjVar:</emph> Object variable that you want to dynamically define at run-time.</paragraph>
56*4346dc92Smseidel<paragraph role="paragraph" id="par_id3153363" xml-lang="en-US" l10n="U"><emph>PropName:</emph> String that specifies the name of the property that you want to address at run-time.</paragraph>
57cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#errorcode"/>
58cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err5"/>
59cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err12"/>
60cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err14"/>
61cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err52"/>
62cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err57"/>
63cdf0e10cSrcweir</body>
64cdf0e10cSrcweir</helpdocument>
65