1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir 3cdf0e10cSrcweir 4*d33d0967SAndrew Rist<!--*********************************************************** 5cdf0e10cSrcweir * 6*d33d0967SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 7*d33d0967SAndrew Rist * or more contributor license agreements. See the NOTICE file 8*d33d0967SAndrew Rist * distributed with this work for additional information 9*d33d0967SAndrew Rist * regarding copyright ownership. The ASF licenses this file 10*d33d0967SAndrew Rist * to you under the Apache License, Version 2.0 (the 11*d33d0967SAndrew Rist * "License"); you may not use this file except in compliance 12*d33d0967SAndrew Rist * with the License. You may obtain a copy of the License at 13*d33d0967SAndrew Rist * 14*d33d0967SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 15*d33d0967SAndrew Rist * 16*d33d0967SAndrew Rist * Unless required by applicable law or agreed to in writing, 17*d33d0967SAndrew Rist * software distributed under the License is distributed on an 18*d33d0967SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19*d33d0967SAndrew Rist * KIND, either express or implied. See the License for the 20*d33d0967SAndrew Rist * specific language governing permissions and limitations 21*d33d0967SAndrew Rist * under the License. 22*d33d0967SAndrew Rist * 23*d33d0967SAndrew Rist ***********************************************************--> 24*d33d0967SAndrew Rist 25*d33d0967SAndrew Rist 26cdf0e10cSrcweir 27cdf0e10cSrcweir<helpdocument version="1.0"> 28cdf0e10cSrcweir<meta> 29cdf0e10cSrcweir<topic id="textsbasicshared03103600xml" indexer="include" status="PUBLISH"> 30cdf0e10cSrcweir<title id="tit" xml-lang="en-US">TypeName Function; VarType Function[Runtime]</title> 31cdf0e10cSrcweir<filename>/text/sbasic/shared/03103600.xhp</filename> 32cdf0e10cSrcweir</topic> 33cdf0e10cSrcweir<history> 34cdf0e10cSrcweir<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created> 35cdf0e10cSrcweir<lastedited date="2004-12-15T10:34:49">converted from old format - fpe</lastedited> 36cdf0e10cSrcweir</history> 37cdf0e10cSrcweir</meta> 38cdf0e10cSrcweir<body> 39cdf0e10cSrcweir<section id="typename"> 40cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id3143267"><bookmark_value>TypeName function</bookmark_value> 41cdf0e10cSrcweir<bookmark_value>VarType function</bookmark_value> 42cdf0e10cSrcweir</bookmark> 43cdf0e10cSrcweir<paragraph role="heading" id="hd_id3143267" xml-lang="en-US" level="1" l10n="U" oldref="1"><link href="text/sbasic/shared/03103600.xhp" name="TypeName Function; VarType Function[Runtime]">TypeName Function; VarType Function[Runtime]</link></paragraph> 44cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3159157" xml-lang="en-US" l10n="U" oldref="2">Returns a string (TypeName) or a numeric value (VarType) that contains information for a variable.</paragraph> 45cdf0e10cSrcweir</section> 46cdf0e10cSrcweir<paragraph role="heading" id="hd_id3153825" xml-lang="en-US" level="2" l10n="U" oldref="3">Syntax:</paragraph> 47cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155341" xml-lang="en-US" l10n="U" oldref="4">TypeName (Variable)VarType (Variable)</paragraph> 48cdf0e10cSrcweir<paragraph role="heading" id="hd_id3145610" xml-lang="en-US" level="2" l10n="U" oldref="5">Return value:</paragraph> 49cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148947" xml-lang="en-US" l10n="U" oldref="6">String; Integer</paragraph> 50cdf0e10cSrcweir<paragraph role="heading" id="hd_id3146795" xml-lang="en-US" level="2" l10n="U" oldref="7">Parameters:</paragraph> 51cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148664" xml-lang="en-US" l10n="U" oldref="8"> 52cdf0e10cSrcweir<emph>Variable:</emph> The variable that you want to determine the type of. You can use the following values:</paragraph> 53cdf0e10cSrcweir<table id="tbl_id3153362"> 54cdf0e10cSrcweir<tablerow> 55cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 56cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145171" xml-lang="en-US" l10n="U" oldref="9">key word</paragraph> 57cdf0e10cSrcweir</tablecell> 58cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 59cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3156212" xml-lang="en-US" l10n="U" oldref="10">VarType</paragraph> 60cdf0e10cSrcweir</tablecell> 61cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 62cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154684" xml-lang="en-US" l10n="U" oldref="11">Variable type</paragraph> 63cdf0e10cSrcweir</tablecell> 64cdf0e10cSrcweir</tablerow> 65cdf0e10cSrcweir<tablerow> 66cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 67cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3151041" xml-lang="en-US" l10n="U" oldref="12">Boolean</paragraph> 68cdf0e10cSrcweir</tablecell> 69cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 70cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3153367" xml-lang="en-US" l10n="U" oldref="13">11</paragraph> 71cdf0e10cSrcweir</tablecell> 72cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 73cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148645" xml-lang="en-US" l10n="U" oldref="14">Boolean variable</paragraph> 74cdf0e10cSrcweir</tablecell> 75cdf0e10cSrcweir</tablerow> 76cdf0e10cSrcweir<tablerow> 77cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 78cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3153138" xml-lang="en-US" l10n="U" oldref="15">Date</paragraph> 79cdf0e10cSrcweir</tablecell> 80cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 81cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3153363" xml-lang="en-US" l10n="U" oldref="16">7</paragraph> 82cdf0e10cSrcweir</tablecell> 83cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 84cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155411" xml-lang="en-US" l10n="U" oldref="17">Date variable</paragraph> 85cdf0e10cSrcweir</tablecell> 86cdf0e10cSrcweir</tablerow> 87cdf0e10cSrcweir<tablerow> 88cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 89cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3146975" xml-lang="en-US" l10n="U" oldref="18">Double</paragraph> 90cdf0e10cSrcweir</tablecell> 91cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 92cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150486" xml-lang="en-US" l10n="U" oldref="19">5</paragraph> 93cdf0e10cSrcweir</tablecell> 94cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 95cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148616" xml-lang="en-US" l10n="U" oldref="20">Double floating point variable</paragraph> 96cdf0e10cSrcweir</tablecell> 97cdf0e10cSrcweir</tablerow> 98cdf0e10cSrcweir<tablerow> 99cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 100cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148457" xml-lang="en-US" l10n="U" oldref="21">Integer</paragraph> 101cdf0e10cSrcweir</tablecell> 102cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 103cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145647" xml-lang="en-US" l10n="U" oldref="22">2</paragraph> 104cdf0e10cSrcweir</tablecell> 105cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 106cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154490" xml-lang="en-US" l10n="U" oldref="23">Integer variable</paragraph> 107cdf0e10cSrcweir</tablecell> 108cdf0e10cSrcweir</tablerow> 109cdf0e10cSrcweir<tablerow> 110cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 111cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3149960" xml-lang="en-US" l10n="U" oldref="24">Long</paragraph> 112cdf0e10cSrcweir</tablecell> 113cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 114cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154513" xml-lang="en-US" l10n="U" oldref="25">3</paragraph> 115cdf0e10cSrcweir</tablecell> 116cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 117cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3151318" xml-lang="en-US" l10n="U" oldref="26">Long integer variable</paragraph> 118cdf0e10cSrcweir</tablecell> 119cdf0e10cSrcweir</tablerow> 120cdf0e10cSrcweir<tablerow> 121cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 122cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3146972" xml-lang="en-US" l10n="U" oldref="27">Object</paragraph> 123cdf0e10cSrcweir</tablecell> 124cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 125cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154482" xml-lang="en-US" l10n="U" oldref="28">9</paragraph> 126cdf0e10cSrcweir</tablecell> 127cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 128cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150323" xml-lang="en-US" l10n="U" oldref="29">Object variable</paragraph> 129cdf0e10cSrcweir</tablecell> 130cdf0e10cSrcweir</tablerow> 131cdf0e10cSrcweir<tablerow> 132cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 133cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148405" xml-lang="en-US" l10n="U" oldref="30">Single</paragraph> 134cdf0e10cSrcweir</tablecell> 135cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 136cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3149020" xml-lang="en-US" l10n="U" oldref="31">4</paragraph> 137cdf0e10cSrcweir</tablecell> 138cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 139cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3147341" xml-lang="en-US" l10n="U" oldref="32">Single floating-point variable</paragraph> 140cdf0e10cSrcweir</tablecell> 141cdf0e10cSrcweir</tablerow> 142cdf0e10cSrcweir<tablerow> 143cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 144cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155901" xml-lang="en-US" l10n="U" oldref="33">String</paragraph> 145cdf0e10cSrcweir</tablecell> 146cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 147cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155960" xml-lang="en-US" l10n="U" oldref="34">8</paragraph> 148cdf0e10cSrcweir</tablecell> 149cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 150cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3146313" xml-lang="en-US" l10n="U" oldref="35">String variable</paragraph> 151cdf0e10cSrcweir</tablecell> 152cdf0e10cSrcweir</tablerow> 153cdf0e10cSrcweir<tablerow> 154cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 155cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145149" xml-lang="en-US" l10n="U" oldref="36">Variant</paragraph> 156cdf0e10cSrcweir</tablecell> 157cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 158cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154021" xml-lang="en-US" l10n="U" oldref="37">12</paragraph> 159cdf0e10cSrcweir</tablecell> 160cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 161cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145789" xml-lang="en-US" l10n="U" oldref="38">Variant variable (can contain all types specified by the definition)</paragraph> 162cdf0e10cSrcweir</tablecell> 163cdf0e10cSrcweir</tablerow> 164cdf0e10cSrcweir<tablerow> 165cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 166cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148630" xml-lang="en-US" l10n="U" oldref="39">Empty</paragraph> 167cdf0e10cSrcweir</tablecell> 168cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 169cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3152584" xml-lang="en-US" l10n="U" oldref="40">0</paragraph> 170cdf0e10cSrcweir</tablecell> 171cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 172cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3151278" xml-lang="en-US" l10n="U" oldref="41">Variable is not initialized</paragraph> 173cdf0e10cSrcweir</tablecell> 174cdf0e10cSrcweir</tablerow> 175cdf0e10cSrcweir<tablerow> 176cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 177cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154576" xml-lang="en-US" l10n="U" oldref="42">Null</paragraph> 178cdf0e10cSrcweir</tablecell> 179cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 180cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3166424" xml-lang="en-US" l10n="U" oldref="43">1</paragraph> 181cdf0e10cSrcweir</tablecell> 182cdf0e10cSrcweir<tablecell colspan="" rowspan=""> 183cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145131" xml-lang="en-US" l10n="U" oldref="44">No valid data</paragraph> 184cdf0e10cSrcweir</tablecell> 185cdf0e10cSrcweir</tablerow> 186cdf0e10cSrcweir</table> 187cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#errorcode"/> 188cdf0e10cSrcweir<embed href="text/sbasic/shared/00000003.xhp#err5"/> 189cdf0e10cSrcweir<paragraph role="heading" id="hd_id3149338" xml-lang="en-US" level="2" l10n="U" oldref="45">Example:</paragraph> 190cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150363" xml-lang="en-US" l10n="U" oldref="46">Sub ExampleType</paragraph> 191cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3159088" xml-lang="en-US" l10n="U" oldref="47">Dim iVar As Integer</paragraph> 192cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150089" xml-lang="en-US" l10n="U" oldref="48">Dim sVar As String</paragraph> 193cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3156139" xml-lang="en-US" l10n="U" oldref="49">Dim siVar As Single</paragraph> 194cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3151217" xml-lang="en-US" l10n="U" oldref="50">Dim dVar As Double</paragraph> 195cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154658" xml-lang="en-US" l10n="U" oldref="51">Dim bVar As Boolean</paragraph> 196cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3152992" xml-lang="en-US" l10n="U" oldref="52">Dim lVar As Long</paragraph> 197cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155509" xml-lang="en-US" l10n="U" oldref="53">Msgbox TypeName(iVar) & " " & VarType(iVar) & Chr(13) &_</paragraph> 198cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150370" xml-lang="en-US" l10n="CHG" oldref="54">TypeName(sVar) & " " & VarType(sVar) & Chr(13) &_</paragraph> 199cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3155532" xml-lang="en-US" l10n="U" oldref="55">TypeName(siVar) & " " & VarType(siVar) & Chr(13) &_</paragraph> 200cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3152988" xml-lang="en-US" l10n="U" oldref="56">TypeName(dVar) & " " & VarType(dVar) & Chr(13) &_</paragraph> 201cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3156166" xml-lang="en-US" l10n="U" oldref="57">TypeName(bVar) & " " & VarType(bVar) & Chr(13) &_</paragraph> 202cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3148817" xml-lang="en-US" l10n="U" oldref="58">TypeName(lVar) & " " & VarType(lVar),0,"Some types in $[officename] Basic"</paragraph> 203cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3154259" xml-lang="en-US" l10n="U" oldref="59">end Sub</paragraph> 204cdf0e10cSrcweir</body> 205cdf0e10cSrcweir</helpdocument> 206