diff options
Diffstat (limited to 'source/text/sbasic/shared/03080801.xhp')
-rw-r--r-- | source/text/sbasic/shared/03080801.xhp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/source/text/sbasic/shared/03080801.xhp b/source/text/sbasic/shared/03080801.xhp index 7d751a1fdd..b01994e23c 100644 --- a/source/text/sbasic/shared/03080801.xhp +++ b/source/text/sbasic/shared/03080801.xhp @@ -47,7 +47,9 @@ <paragraph role="paragraph" id="par_id3145136" xml-lang="en-US" l10n="U" oldref="2">Returns a string that represents the hexadecimal value of a number.</paragraph> </section> <paragraph role="heading" id="hd_id3147573" xml-lang="en-US" level="2" l10n="U" oldref="3">Syntax:</paragraph> -<paragraph role="paragraph" id="par_id3150771" xml-lang="en-US" l10n="U" oldref="4">Hex (Number)</paragraph> +<bascode>
+<paragraph role="bascode" id="par_id3150771" xml-lang="en-US" oldref="4">Hex (Number)</paragraph>
+</bascode> <paragraph role="heading" id="hd_id3147530" xml-lang="en-US" level="2" l10n="U" oldref="5">Return value:</paragraph> <paragraph role="paragraph" id="par_id3159414" xml-lang="en-US" l10n="U" oldref="6">String</paragraph> <paragraph role="heading" id="hd_id3156344" xml-lang="en-US" level="2" l10n="U" oldref="7">Parameters:</paragraph> @@ -56,22 +58,26 @@ <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> <paragraph role="heading" id="hd_id3154365" xml-lang="en-US" level="2" l10n="U" oldref="9">Example:</paragraph> -<paragraph role="paragraph" id="par_id3145420" xml-lang="en-US" l10n="U" oldref="29">Sub ExampleHex</paragraph> -<paragraph role="paragraph" id="par_id3156214" xml-lang="en-US" l10n="U" oldref="30">REM uses BasicFormulas in $[officename] Calc</paragraph> -<paragraph role="paragraph" id="par_id3153970" xml-lang="en-US" l10n="U" oldref="31">Dim a2, b2, c2 as String</paragraph> -<paragraph role="paragraph" id="par_id3154909" xml-lang="en-US" l10n="U" oldref="32">a2 = "&H3E8"</paragraph> -<paragraph role="paragraph" id="par_id3148674" xml-lang="en-US" l10n="U" oldref="33">b2 = Hex2Int(a2)</paragraph> -<paragraph role="paragraph" id="par_id3155132" xml-lang="en-US" l10n="U" oldref="34">MsgBox b2</paragraph> -<paragraph role="paragraph" id="par_id3150440" xml-lang="en-US" l10n="U" oldref="35">c2 = Int2Hex(b2)</paragraph> -<paragraph role="paragraph" id="par_id3147427" xml-lang="en-US" l10n="U" oldref="36">MsgBox c2</paragraph> -<paragraph role="paragraph" id="par_id3147435" xml-lang="en-US" l10n="U" oldref="37">End Sub</paragraph> -<paragraph role="paragraph" id="par_id3148645" xml-lang="en-US" l10n="U" oldref="19">Function Hex2Int( sHex As String ) As Long</paragraph> -<paragraph role="paragraph" id="par_id3149262" xml-lang="en-US" l10n="U" oldref="20">REM Returns a Long-Integer from a hexadecimal value.</paragraph> -<paragraph role="paragraph" id="par_id3148616" xml-lang="en-US" l10n="U" oldref="21">Hex2Int = clng( sHex )</paragraph> -<paragraph role="paragraph" id="par_id3153952" xml-lang="en-US" l10n="U" oldref="22">End Function</paragraph> -<paragraph role="paragraph" id="par_id3146984" xml-lang="en-US" l10n="U" oldref="24">Function Int2Hex( iLong As Long) As String</paragraph> -<paragraph role="paragraph" id="par_id3147215" xml-lang="en-US" l10n="U" oldref="25">REM Calculates a hexadecimal value in Integer.</paragraph> -<paragraph role="paragraph" id="par_id3148575" xml-lang="en-US" l10n="U" oldref="26">Int2Hex = "&H" & Hex( iLong )</paragraph> -<paragraph role="paragraph" id="par_id3151073" xml-lang="en-US" l10n="U" oldref="27">End Function</paragraph> +<bascode> +<paragraph role="bascode" localize="false" xml-lang="en-US">Sub ExampleHex</paragraph> +<paragraph role="bascode" id="par_id3156214" xml-lang="en-US" l10n="U" oldref="30">' uses BasicFormulas in $[officename] Calc</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Dim a2, b2, c2 As String</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> a2 = "&H3E8"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> b2 = Hex2Int(a2)</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> MsgBox b2</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> c2 = Int2Hex(b2)</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> MsgBox c2</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> </paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Function Hex2Int( sHex As String ) As Long</paragraph> +<paragraph role="bascode" id="par_id3149262" xml-lang="en-US" l10n="U" oldref="20">' Returns a long integer from a hexadecimal value.</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Hex2Int = clng( sHex )</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> </paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Function Int2Hex( iLong As Long) As String</paragraph> +<paragraph role="bascode" id="par_id3147215" xml-lang="en-US" l10n="U" oldref="25">' Calculates a hexadecimal value in integer.</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Int2Hex = "&H" & Hex( iLong )</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> +</bascode> </body> </helpdocument> |